Skip to content

Commit 3ee48db

Browse files
committed
[MIG] pos_receipt_hide_price: Migration to 16.0
1 parent 8debf3a commit 3ee48db

File tree

12 files changed

+47
-43
lines changed

12 files changed

+47
-43
lines changed

pos_receipt_hide_price/README.rst

+4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ Contributors
7373

7474
* Florian Mounier
7575

76+
* `FactorLibre <https://factorlibre.com/>`_:
77+
78+
* Daniel Duque
79+
7680
Maintainers
7781
~~~~~~~~~~~
7882

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
# Copyright 2021 Akretion - Florian Mounier
2+
# Copyright 2022 FactorLibre - Daniel Duque
23
{
34
"name": "POS Receipt Hide Price",
45
"summary": "Add button to remove price from receipt.",
5-
"author": "Akretion, Odoo Community Association (OCA)",
6+
"author": "Akretion, FactorLibre, Odoo Community Association (OCA)",
67
"website": "https://github.com/OCA/pos",
78
"category": "Point of Sale",
8-
"version": "14.0.1.0.1",
9+
"version": "16.0.1.0.0",
910
"license": "LGPL-3",
1011
"depends": ["point_of_sale"],
11-
"data": ["views/assets.xml"],
12-
"qweb": [
13-
"static/src/xml/OrderReceipt.xml",
14-
"static/src/xml/HidePrice.xml",
15-
"static/src/xml/ReceiptScreen.xml",
16-
"static/src/xml/ReprintReceiptScreen.xml",
17-
],
12+
"assets": {
13+
"point_of_sale.assets": [
14+
"pos_receipt_hide_price/static/src/js/ReceiptScreen.js",
15+
"pos_receipt_hide_price/static/src/js/ReprintReceiptScreen.js",
16+
"pos_receipt_hide_price/static/src/js/OrderReceipt.js",
17+
"pos_receipt_hide_price/static/src/xml/**/*",
18+
],
19+
},
1820
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
* `Akretion <https://www.akretion.com>`_:
22

33
* Florian Mounier
4+
5+
* `FactorLibre <https://factorlibre.com/>`_:
6+
7+
* Daniel Duque

pos_receipt_hide_price/static/src/js/OrderReceipt.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ odoo.define("pos_receipt_hide_price.OrderReceipt", function (require) {
44
const OrderReceipt = require("point_of_sale.OrderReceipt");
55
const Registries = require("point_of_sale.Registries");
66

7-
const HidePriceOrderReceipt = (OrderReceipt) =>
8-
class extends OrderReceipt {
9-
constructor(_, {hidePriceState}) {
7+
const HidePriceOrderReceipt = (OriginalOrderReceipt) =>
8+
class extends OriginalOrderReceipt {
9+
constructor({hidePriceState}) {
1010
super(...arguments);
1111
this.hidePriceState = hidePriceState;
1212
}

pos_receipt_hide_price/static/src/js/ReceiptScreen.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
odoo.define("pos_receipt_hide_price.ReceiptScreen", function (require) {
22
"use strict";
33

4-
const {useState} = owl.hooks;
4+
const {useState} = owl;
55
const ReceiptScreen = require("point_of_sale.ReceiptScreen");
66
const Registries = require("point_of_sale.Registries");
77

8-
const HidePriceReceiptScreen = (ReceiptScreen) =>
9-
class extends ReceiptScreen {
8+
const HidePriceReceiptScreen = (OriginalReceiptScreen) =>
9+
class extends OriginalReceiptScreen {
1010
constructor() {
1111
super(...arguments);
1212
this.hidePriceState = useState({priceHidden: false});

pos_receipt_hide_price/static/src/js/ReprintReceiptScreen.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
odoo.define("pos_receipt_hide_price.ReprintReceiptScreen", function (require) {
22
"use strict";
33

4-
const {useState} = owl.hooks;
4+
const {useState} = owl;
55
const ReprintReceiptScreen = require("point_of_sale.ReprintReceiptScreen");
66
const Registries = require("point_of_sale.Registries");
77

8-
const HidePriceReprintReceiptScreen = (ReprintReceiptScreen) =>
9-
class extends ReprintReceiptScreen {
8+
const HidePriceReprintReceiptScreen = (OriginalReprintReceiptScreen) =>
9+
class extends OriginalReprintReceiptScreen {
1010
constructor() {
1111
super(...arguments);
1212
this.hidePriceState = useState({priceHidden: false});

pos_receipt_hide_price/static/src/xml/OrderReceipt.xml

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<templates id="template" xml:space="preserve">
2-
<t t-inherit="point_of_sale.OrderReceipt" t-inherit-mode="extension">
3-
<!-- Attributes position xpath only apply to first match for some reason: -->
4-
<!-- https://github.com/odoo/odoo/issues/23862 -->
2+
<t t-inherit="point_of_sale.OrderLinesReceipt" t-inherit-mode="extension" owl="1">
53
<!-- Simple price -->
64
<xpath expr="//t[@t-if='isSimple(line)']/div/span" position="attributes">
75
<attribute name="t-att-class">{'oe_hidden': priceHidden}</attribute>
@@ -31,7 +29,10 @@
3129
</div>
3230
</t>
3331
</xpath>
34-
32+
</t>
33+
<t t-inherit="point_of_sale.OrderReceipt" t-inherit-mode="extension" owl="1">
34+
<!-- Attributes position xpath only apply to first match for some reason: -->
35+
<!-- https://github.com/odoo/odoo/issues/23862 -->
3536
<!-- Tax included -->
3637
<xpath expr="//t[@t-if='!isTaxIncluded']/div[1]" position="attributes">
3738
<attribute name="t-att-class">{'oe_hidden': priceHidden}</attribute>
@@ -85,6 +86,11 @@
8586
<xpath expr="//t[@t-foreach='receipt.tax_details']/div" position="attributes">
8687
<attribute name="t-att-class">{'oe_hidden': priceHidden}</attribute>
8788
</xpath>
89+
90+
<xpath expr="//t[@t-if='isTaxIncluded']/t[@t-foreach]/div" position="attributes">
91+
<attribute name="t-att-class">{'oe_hidden': priceHidden}</attribute>
92+
</xpath>
93+
8894
<xpath expr="//t[@t-if='isTaxIncluded']/div" position="attributes">
8995
<attribute name="t-att-class">{'oe_hidden': priceHidden}</attribute>
9096
</xpath>

pos_receipt_hide_price/static/src/xml/ReceiptScreen.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<templates id="template" xml:space="preserve">
2-
<t t-inherit="point_of_sale.ReceiptScreen" t-inherit-mode="extension">
2+
<t t-inherit="point_of_sale.ReceiptScreen" t-inherit-mode="extension" owl="1">
33
<xpath expr="//div[hasclass('button', 'print')]" position="before">
44
<t t-call="pos_receipt_hide_price.hide_price" />
55
</xpath>

pos_receipt_hide_price/static/src/xml/ReprintReceiptScreen.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<templates id="template" xml:space="preserve">
2-
<t t-inherit="point_of_sale.ReprintReceiptScreen" t-inherit-mode="extension">
2+
<t t-inherit="point_of_sale.ReprintReceiptScreen" t-inherit-mode="extension" owl="1">
33
<xpath expr="//div[hasclass('button', 'print')]" position="after">
44
<t t-call="pos_receipt_hide_price.hide_price" />
55
</xpath>

pos_receipt_hide_price/views/assets.xml

-19
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../pos_receipt_hide_price

setup/pos_receipt_hide_price/setup.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import setuptools
2+
3+
setuptools.setup(
4+
setup_requires=['setuptools-odoo'],
5+
odoo_addon=True,
6+
)

0 commit comments

Comments
 (0)