From eec29ec1eacb7be0401760625d7d1ec346721e57 Mon Sep 17 00:00:00 2001 From: rhe-odoo Date: Fri, 3 Jun 2022 07:55:06 +0000 Subject: [PATCH] [IMP] l10n_fr_pos_cert: allow price modification Currently, the module l10n_fr_pos_cert (France - VAT Anti-Fraud Certification): Prevent price modification Prevent from inserting negative lines while decreasing quantity Hash links between orders Print the hash onto the ticket This commit allows the price modification of the products. To be compliant with the law, we track any price modification on the ticket and on the product screen. Task-id: 2610576 Part-of: odoo/odoo#92854 --- addons/l10n_fr_pos_cert/__manifest__.py | 1 + .../l10n_fr_pos_cert/static/src/css/pos.css | 3 +++ addons/l10n_fr_pos_cert/static/src/js/pos.js | 7 ------- .../static/src/xml/OrderReceipt.xml | 15 +++++++++++++++ .../static/src/xml/Orderline.xml | 19 +++++++++++++++++++ addons/point_of_sale/static/src/js/models.js | 2 ++ 6 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 addons/l10n_fr_pos_cert/static/src/css/pos.css create mode 100644 addons/l10n_fr_pos_cert/static/src/xml/Orderline.xml diff --git a/addons/l10n_fr_pos_cert/__manifest__.py b/addons/l10n_fr_pos_cert/__manifest__.py index 9fc111c77f4..46df5dde437 100644 --- a/addons/l10n_fr_pos_cert/__manifest__.py +++ b/addons/l10n_fr_pos_cert/__manifest__.py @@ -39,6 +39,7 @@ The module adds following features: 'assets': { 'point_of_sale.assets': [ 'l10n_fr_pos_cert/static/src/js/**/*', + 'l10n_fr_pos_cert/static/src/css/pos.css', ], 'web.assets_qweb': [ 'l10n_fr_pos_cert/static/src/xml/**/*', diff --git a/addons/l10n_fr_pos_cert/static/src/css/pos.css b/addons/l10n_fr_pos_cert/static/src/css/pos.css new file mode 100644 index 00000000000..57dca4137df --- /dev/null +++ b/addons/l10n_fr_pos_cert/static/src/css/pos.css @@ -0,0 +1,3 @@ +.oldPrice { + font-weight: bold; +} \ No newline at end of file diff --git a/addons/l10n_fr_pos_cert/static/src/js/pos.js b/addons/l10n_fr_pos_cert/static/src/js/pos.js index bbfbc5aa283..0b7853c1191 100644 --- a/addons/l10n_fr_pos_cert/static/src/js/pos.js +++ b/addons/l10n_fr_pos_cert/static/src/js/pos.js @@ -24,13 +24,6 @@ const L10nFrPosGlobalState = (PosGlobalState) => class L10nFrPosGlobalState exte let result = super.disallowLineQuantityChange(...arguments); return this.is_french_country() || result; } - cashierHasPriceControlRights() { - if (this.is_french_country()) { - return false; - } else { - return super.cashierHasPriceControlRights(); - } - } } Registries.Model.extend(PosGlobalState, L10nFrPosGlobalState); diff --git a/addons/l10n_fr_pos_cert/static/src/xml/OrderReceipt.xml b/addons/l10n_fr_pos_cert/static/src/xml/OrderReceipt.xml index bb77291ac8a..2a5d3fe3a1b 100644 --- a/addons/l10n_fr_pos_cert/static/src/xml/OrderReceipt.xml +++ b/addons/l10n_fr_pos_cert/static/src/xml/OrderReceipt.xml @@ -8,4 +8,19 @@ + + + + +
+ Old unit price: + + + / Units + + +
+
+
+
diff --git a/addons/l10n_fr_pos_cert/static/src/xml/Orderline.xml b/addons/l10n_fr_pos_cert/static/src/xml/Orderline.xml new file mode 100644 index 00000000000..80880efd673 --- /dev/null +++ b/addons/l10n_fr_pos_cert/static/src/xml/Orderline.xml @@ -0,0 +1,19 @@ + + + + + + +
  • + Old unit price: + + + / Units + + +
  • +
    +
    +
    + +
    diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 457a7acbaff..de9daf2e001 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -1505,6 +1505,8 @@ class Orderline extends PosModel { product_name: this.get_product().display_name, product_name_wrapped: this.generate_wrapped_product_name(), price_lst: this.get_lst_price(), + fixed_lst_price: this.get_fixed_lst_price(), + price_manually_set: this.price_manually_set, display_discount_policy: this.display_discount_policy(), price_display_one: this.get_display_price_one(), price_display : this.get_display_price(),