From fb6caebbc1ef8b93d87079b56df82fc5d38cb2e6 Mon Sep 17 00:00:00 2001 From: Daniel Duque Date: Fri, 7 Oct 2022 11:28:28 +0200 Subject: [PATCH] [MIG] pos_receipt_hide_price: Migration to 16.0 --- pos_receipt_hide_price/README.rst | 4 ++++ pos_receipt_hide_price/__manifest__.py | 20 ++++++++++--------- .../readme/CONTRIBUTORS.rst | 4 ++++ .../static/src/js/OrderReceipt.js | 6 +++--- .../static/src/js/ReceiptScreen.js | 6 +++--- .../static/src/js/ReprintReceiptScreen.js | 6 +++--- .../static/src/xml/OrderReceipt.xml | 14 +++++++++---- .../static/src/xml/ReceiptScreen.xml | 2 +- .../static/src/xml/ReprintReceiptScreen.xml | 2 +- pos_receipt_hide_price/views/assets.xml | 19 ------------------ .../odoo/addons/pos_receipt_hide_price | 1 + setup/pos_receipt_hide_price/setup.py | 6 ++++++ 12 files changed, 47 insertions(+), 43 deletions(-) delete mode 100644 pos_receipt_hide_price/views/assets.xml create mode 120000 setup/pos_receipt_hide_price/odoo/addons/pos_receipt_hide_price create mode 100644 setup/pos_receipt_hide_price/setup.py diff --git a/pos_receipt_hide_price/README.rst b/pos_receipt_hide_price/README.rst index 7aa2b337b6..ce0e4fcc5d 100644 --- a/pos_receipt_hide_price/README.rst +++ b/pos_receipt_hide_price/README.rst @@ -73,6 +73,10 @@ Contributors * Florian Mounier +* `FactorLibre `_: + + * Daniel Duque + Maintainers ~~~~~~~~~~~ diff --git a/pos_receipt_hide_price/__manifest__.py b/pos_receipt_hide_price/__manifest__.py index 2f758a62d2..276d60246f 100644 --- a/pos_receipt_hide_price/__manifest__.py +++ b/pos_receipt_hide_price/__manifest__.py @@ -1,18 +1,20 @@ # Copyright 2021 Akretion - Florian Mounier +# Copyright 2022 FactorLibre - Daniel Duque { "name": "POS Receipt Hide Price", "summary": "Add button to remove price from receipt.", - "author": "Akretion, Odoo Community Association (OCA)", + "author": "Akretion, FactorLibre, Odoo Community Association (OCA)", "website": "https://github.com/OCA/pos", "category": "Point of Sale", - "version": "14.0.1.0.1", + "version": "16.0.1.0.0", "license": "LGPL-3", "depends": ["point_of_sale"], - "data": ["views/assets.xml"], - "qweb": [ - "static/src/xml/OrderReceipt.xml", - "static/src/xml/HidePrice.xml", - "static/src/xml/ReceiptScreen.xml", - "static/src/xml/ReprintReceiptScreen.xml", - ], + "assets": { + "point_of_sale.assets": [ + "pos_receipt_hide_price/static/src/js/ReceiptScreen.js", + "pos_receipt_hide_price/static/src/js/ReprintReceiptScreen.js", + "pos_receipt_hide_price/static/src/js/OrderReceipt.js", + "pos_receipt_hide_price/static/src/xml/**/*", + ], + }, } diff --git a/pos_receipt_hide_price/readme/CONTRIBUTORS.rst b/pos_receipt_hide_price/readme/CONTRIBUTORS.rst index a4d0ad9229..e0838d10b6 100644 --- a/pos_receipt_hide_price/readme/CONTRIBUTORS.rst +++ b/pos_receipt_hide_price/readme/CONTRIBUTORS.rst @@ -1,3 +1,7 @@ * `Akretion `_: * Florian Mounier + +* `FactorLibre `_: + + * Daniel Duque diff --git a/pos_receipt_hide_price/static/src/js/OrderReceipt.js b/pos_receipt_hide_price/static/src/js/OrderReceipt.js index b6b208a598..3b61f431ff 100644 --- a/pos_receipt_hide_price/static/src/js/OrderReceipt.js +++ b/pos_receipt_hide_price/static/src/js/OrderReceipt.js @@ -4,9 +4,9 @@ odoo.define("pos_receipt_hide_price.OrderReceipt", function (require) { const OrderReceipt = require("point_of_sale.OrderReceipt"); const Registries = require("point_of_sale.Registries"); - const HidePriceOrderReceipt = (OrderReceipt) => - class extends OrderReceipt { - constructor(_, {hidePriceState}) { + const HidePriceOrderReceipt = (OriginalOrderReceipt) => + class extends OriginalOrderReceipt { + constructor({hidePriceState}) { super(...arguments); this.hidePriceState = hidePriceState; } diff --git a/pos_receipt_hide_price/static/src/js/ReceiptScreen.js b/pos_receipt_hide_price/static/src/js/ReceiptScreen.js index e6601ef423..958fe0fe2c 100644 --- a/pos_receipt_hide_price/static/src/js/ReceiptScreen.js +++ b/pos_receipt_hide_price/static/src/js/ReceiptScreen.js @@ -1,12 +1,12 @@ odoo.define("pos_receipt_hide_price.ReceiptScreen", function (require) { "use strict"; - const {useState} = owl.hooks; + const {useState} = owl; const ReceiptScreen = require("point_of_sale.ReceiptScreen"); const Registries = require("point_of_sale.Registries"); - const HidePriceReceiptScreen = (ReceiptScreen) => - class extends ReceiptScreen { + const HidePriceReceiptScreen = (OriginalReceiptScreen) => + class extends OriginalReceiptScreen { constructor() { super(...arguments); this.hidePriceState = useState({priceHidden: false}); diff --git a/pos_receipt_hide_price/static/src/js/ReprintReceiptScreen.js b/pos_receipt_hide_price/static/src/js/ReprintReceiptScreen.js index 32b0988542..cc55d749da 100644 --- a/pos_receipt_hide_price/static/src/js/ReprintReceiptScreen.js +++ b/pos_receipt_hide_price/static/src/js/ReprintReceiptScreen.js @@ -1,12 +1,12 @@ odoo.define("pos_receipt_hide_price.ReprintReceiptScreen", function (require) { "use strict"; - const {useState} = owl.hooks; + const {useState} = owl; const ReprintReceiptScreen = require("point_of_sale.ReprintReceiptScreen"); const Registries = require("point_of_sale.Registries"); - const HidePriceReprintReceiptScreen = (ReprintReceiptScreen) => - class extends ReprintReceiptScreen { + const HidePriceReprintReceiptScreen = (OriginalReprintReceiptScreen) => + class extends OriginalReprintReceiptScreen { constructor() { super(...arguments); this.hidePriceState = useState({priceHidden: false}); diff --git a/pos_receipt_hide_price/static/src/xml/OrderReceipt.xml b/pos_receipt_hide_price/static/src/xml/OrderReceipt.xml index 2dc765dcf6..1101d068eb 100644 --- a/pos_receipt_hide_price/static/src/xml/OrderReceipt.xml +++ b/pos_receipt_hide_price/static/src/xml/OrderReceipt.xml @@ -1,7 +1,5 @@ - - - + {'oe_hidden': priceHidden} @@ -31,7 +29,10 @@ - + + + + {'oe_hidden': priceHidden} @@ -85,6 +86,11 @@ {'oe_hidden': priceHidden} + + + {'oe_hidden': priceHidden} + + {'oe_hidden': priceHidden} diff --git a/pos_receipt_hide_price/static/src/xml/ReceiptScreen.xml b/pos_receipt_hide_price/static/src/xml/ReceiptScreen.xml index 485a16f5a5..ac2c0977c9 100644 --- a/pos_receipt_hide_price/static/src/xml/ReceiptScreen.xml +++ b/pos_receipt_hide_price/static/src/xml/ReceiptScreen.xml @@ -1,5 +1,5 @@ - + diff --git a/pos_receipt_hide_price/static/src/xml/ReprintReceiptScreen.xml b/pos_receipt_hide_price/static/src/xml/ReprintReceiptScreen.xml index cbaff3041c..d21b55758d 100644 --- a/pos_receipt_hide_price/static/src/xml/ReprintReceiptScreen.xml +++ b/pos_receipt_hide_price/static/src/xml/ReprintReceiptScreen.xml @@ -1,5 +1,5 @@ - + diff --git a/pos_receipt_hide_price/views/assets.xml b/pos_receipt_hide_price/views/assets.xml deleted file mode 100644 index b790d22148..0000000000 --- a/pos_receipt_hide_price/views/assets.xml +++ /dev/null @@ -1,19 +0,0 @@ - - -