Skip to content

Commit 647d545

Browse files
committed
[MIG] pos_receipt_hide_price: Migration to 16.0
1 parent b3bd7e4 commit 647d545

9 files changed

+28
-16
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

pos_receipt_hide_price/__manifest__.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
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": "15.0.1.0.0",
9+
"version": "16.0.1.0.0",
910
"license": "LGPL-3",
1011
"depends": ["point_of_sale"],
1112
"assets": {
1213
"point_of_sale.assets": [
1314
"pos_receipt_hide_price/static/src/js/ReceiptScreen.js",
1415
"pos_receipt_hide_price/static/src/js/ReprintReceiptScreen.js",
1516
"pos_receipt_hide_price/static/src/js/OrderReceipt.js",
16-
],
17-
"web.assets_qweb": [
1817
"pos_receipt_hide_price/static/src/xml/**/*",
1918
],
2019
},
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

+6-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</t>
3333
</xpath>
3434
</t>
35-
<t t-inherit="point_of_sale.OrderReceipt" t-inherit-mode="extension">
35+
<t t-inherit="point_of_sale.OrderReceipt" t-inherit-mode="extension" owl="1">
3636
<!-- Tax included -->
3737
<xpath expr="//t[@t-if='!isTaxIncluded']/div[1]" position="attributes">
3838
<attribute name="t-att-class">{'oe_hidden': priceHidden}</attribute>
@@ -86,6 +86,11 @@
8686
<xpath expr="//t[@t-foreach='receipt.tax_details']/div" position="attributes">
8787
<attribute name="t-att-class">{'oe_hidden': priceHidden}</attribute>
8888
</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+
8994
<xpath expr="//t[@t-if='isTaxIncluded']/div" position="attributes">
9095
<attribute name="t-att-class">{'oe_hidden': priceHidden}</attribute>
9196
</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>

0 commit comments

Comments
 (0)