From 1dcc4aa7aaa6eebac5ff34f4354c42d53e42593c Mon Sep 17 00:00:00 2001 From: Camille Morand Date: Tue, 25 Mar 2025 17:41:58 +0700 Subject: [PATCH 01/10] [ADD] pos_barcode_rule_priced_with_change_rate --- .../__init__.py | 1 + .../__manifest__.py | 21 +++++++++ .../i18n/fr.po | 47 +++++++++++++++++++ ...s_barcode_rule_priced_with_change_rate.pot | 47 +++++++++++++++++++ .../models/__init__.py | 3 ++ .../models/barcode_rule.py | 10 ++++ .../models/pos_config.py | 10 ++++ .../models/res_config_settings.py | 10 ++++ .../pyproject.toml | 3 ++ .../readme/CONTRIBUTORS.md | 2 + .../readme/CREDITS.md | 2 + .../readme/DESCRIPTION.md | 1 + .../product_screen/product_screen.esm.js | 42 +++++++++++++++++ .../views/res_config_settings_views.xml | 16 +++++++ 14 files changed, 215 insertions(+) create mode 100644 pos_barcode_rule_priced_with_change_rate/__init__.py create mode 100644 pos_barcode_rule_priced_with_change_rate/__manifest__.py create mode 100644 pos_barcode_rule_priced_with_change_rate/i18n/fr.po create mode 100644 pos_barcode_rule_priced_with_change_rate/i18n/pos_barcode_rule_priced_with_change_rate.pot create mode 100644 pos_barcode_rule_priced_with_change_rate/models/__init__.py create mode 100644 pos_barcode_rule_priced_with_change_rate/models/barcode_rule.py create mode 100644 pos_barcode_rule_priced_with_change_rate/models/pos_config.py create mode 100644 pos_barcode_rule_priced_with_change_rate/models/res_config_settings.py create mode 100644 pos_barcode_rule_priced_with_change_rate/pyproject.toml create mode 100644 pos_barcode_rule_priced_with_change_rate/readme/CONTRIBUTORS.md create mode 100644 pos_barcode_rule_priced_with_change_rate/readme/CREDITS.md create mode 100644 pos_barcode_rule_priced_with_change_rate/readme/DESCRIPTION.md create mode 100644 pos_barcode_rule_priced_with_change_rate/static/src/overrides/components/product_screen/product_screen.esm.js create mode 100644 pos_barcode_rule_priced_with_change_rate/views/res_config_settings_views.xml diff --git a/pos_barcode_rule_priced_with_change_rate/__init__.py b/pos_barcode_rule_priced_with_change_rate/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/pos_barcode_rule_priced_with_change_rate/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/pos_barcode_rule_priced_with_change_rate/__manifest__.py b/pos_barcode_rule_priced_with_change_rate/__manifest__.py new file mode 100644 index 0000000000..f1bb1062b6 --- /dev/null +++ b/pos_barcode_rule_priced_with_change_rate/__manifest__.py @@ -0,0 +1,21 @@ +{ + "name": "Point of Sale - New barcode rule for priced product with change rate", + "version": "17.0.1.0.0", + "category": "Sales/Point of Sale", + "summary": """ + Add a barcode rule to be able to scan a barcode with price encoded (as the + standard "Priced Product" rule), and convert the price according to a given + change rate. + """, + "author": "Odoo Community Association (OCA), Camptocamp", + "website": "https://github.com/OCA/pos", + "depends": ["point_of_sale"], + "data": ["views/res_config_settings_views.xml"], + "assets": { + "point_of_sale._assets_pos": [ + "pos_barcode_rule_priced_with_change_rate/static/src/**/*", + ], + }, + "installable": True, + "license": "AGPL-3", +} diff --git a/pos_barcode_rule_priced_with_change_rate/i18n/fr.po b/pos_barcode_rule_priced_with_change_rate/i18n/fr.po new file mode 100644 index 0000000000..296f751c07 --- /dev/null +++ b/pos_barcode_rule_priced_with_change_rate/i18n/fr.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_barcode_rule_priced_with_change_rate +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-03-25 11:10+0000\n" +"PO-Revision-Date: 2025-03-25 11:10+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: pos_barcode_rule_priced_with_change_rate +#: model:ir.model,name:pos_barcode_rule_priced_with_change_rate.model_barcode_rule +msgid "Barcode Rule" +msgstr "Règle de code-barres" + +#. module: pos_barcode_rule_priced_with_change_rate +#: model:ir.model.fields,field_description:pos_barcode_rule_priced_with_change_rate.field_pos_config__change_rate_barcode +#: model:ir.model.fields,field_description:pos_barcode_rule_priced_with_change_rate.field_res_config_settings__change_rate_barcode +msgid "Change rate for barcode nomenclature" +msgstr "Taux de change pour Nomenclature codes-barres" + +#. module: pos_barcode_rule_priced_with_change_rate +#: model:ir.model,name:pos_barcode_rule_priced_with_change_rate.model_res_config_settings +msgid "Config Settings" +msgstr "Paramètres de configuration" + +#. module: pos_barcode_rule_priced_with_change_rate +#: model:ir.model,name:pos_barcode_rule_priced_with_change_rate.model_pos_config +msgid "Point of Sale Configuration" +msgstr "Configuration du point de vente" + +#. module: pos_barcode_rule_priced_with_change_rate +#: model:ir.model.fields.selection,name:pos_barcode_rule_priced_with_change_rate.selection__barcode_rule__type__price_change_rate +msgid "Priced Product with Change Rate" +msgstr "Produit à prix fixe avec taux de change" + +#. module: pos_barcode_rule_priced_with_change_rate +#: model:ir.model.fields,field_description:pos_barcode_rule_priced_with_change_rate.field_barcode_rule__type +msgid "Type" +msgstr "" diff --git a/pos_barcode_rule_priced_with_change_rate/i18n/pos_barcode_rule_priced_with_change_rate.pot b/pos_barcode_rule_priced_with_change_rate/i18n/pos_barcode_rule_priced_with_change_rate.pot new file mode 100644 index 0000000000..b6c5a391c0 --- /dev/null +++ b/pos_barcode_rule_priced_with_change_rate/i18n/pos_barcode_rule_priced_with_change_rate.pot @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_barcode_rule_priced_with_change_rate +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-03-25 11:07+0000\n" +"PO-Revision-Date: 2025-03-25 11:07+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: pos_barcode_rule_priced_with_change_rate +#: model:ir.model,name:pos_barcode_rule_priced_with_change_rate.model_barcode_rule +msgid "Barcode Rule" +msgstr "" + +#. module: pos_barcode_rule_priced_with_change_rate +#: model:ir.model.fields,field_description:pos_barcode_rule_priced_with_change_rate.field_pos_config__change_rate_barcode +#: model:ir.model.fields,field_description:pos_barcode_rule_priced_with_change_rate.field_res_config_settings__change_rate_barcode +msgid "Change rate for barcode nomenclature" +msgstr "" + +#. module: pos_barcode_rule_priced_with_change_rate +#: model:ir.model,name:pos_barcode_rule_priced_with_change_rate.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: pos_barcode_rule_priced_with_change_rate +#: model:ir.model,name:pos_barcode_rule_priced_with_change_rate.model_pos_config +msgid "Point of Sale Configuration" +msgstr "" + +#. module: pos_barcode_rule_priced_with_change_rate +#: model:ir.model.fields.selection,name:pos_barcode_rule_priced_with_change_rate.selection__barcode_rule__type__price_change_rate +msgid "Priced Product with Change Rate" +msgstr "" + +#. module: pos_barcode_rule_priced_with_change_rate +#: model:ir.model.fields,field_description:pos_barcode_rule_priced_with_change_rate.field_barcode_rule__type +msgid "Type" +msgstr "" diff --git a/pos_barcode_rule_priced_with_change_rate/models/__init__.py b/pos_barcode_rule_priced_with_change_rate/models/__init__.py new file mode 100644 index 0000000000..898c1f8ca0 --- /dev/null +++ b/pos_barcode_rule_priced_with_change_rate/models/__init__.py @@ -0,0 +1,3 @@ +from . import barcode_rule +from . import pos_config +from . import res_config_settings diff --git a/pos_barcode_rule_priced_with_change_rate/models/barcode_rule.py b/pos_barcode_rule_priced_with_change_rate/models/barcode_rule.py new file mode 100644 index 0000000000..099ca2cb0f --- /dev/null +++ b/pos_barcode_rule_priced_with_change_rate/models/barcode_rule.py @@ -0,0 +1,10 @@ +# Copyright 2024 Camptocamp SA (https://www.camptocamp.com). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import models, fields + + +class BarcodeRule(models.Model): + _inherit = 'barcode.rule' + + type = fields.Selection(selection_add=[('price_change_rate', 'Priced Product with Change Rate')], ondelete={'price_change_rate': 'set default'}) diff --git a/pos_barcode_rule_priced_with_change_rate/models/pos_config.py b/pos_barcode_rule_priced_with_change_rate/models/pos_config.py new file mode 100644 index 0000000000..3cad6785c3 --- /dev/null +++ b/pos_barcode_rule_priced_with_change_rate/models/pos_config.py @@ -0,0 +1,10 @@ +# Copyright 2024 Camptocamp SA (https://www.camptocamp.com). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class PosConfig(models.Model): + _inherit = 'pos.config' + + change_rate_barcode = fields.Float(string="Change rate for barcode nomenclature") diff --git a/pos_barcode_rule_priced_with_change_rate/models/res_config_settings.py b/pos_barcode_rule_priced_with_change_rate/models/res_config_settings.py new file mode 100644 index 0000000000..e44a8a0c3d --- /dev/null +++ b/pos_barcode_rule_priced_with_change_rate/models/res_config_settings.py @@ -0,0 +1,10 @@ +# Copyright 2024 Camptocamp SA (https://www.camptocamp.com). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + _inherit = 'res.config.settings' + + change_rate_barcode = fields.Float(related="pos_config_id.change_rate_barcode", readonly=False) diff --git a/pos_barcode_rule_priced_with_change_rate/pyproject.toml b/pos_barcode_rule_priced_with_change_rate/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/pos_barcode_rule_priced_with_change_rate/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/pos_barcode_rule_priced_with_change_rate/readme/CONTRIBUTORS.md b/pos_barcode_rule_priced_with_change_rate/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..7b7784d15b --- /dev/null +++ b/pos_barcode_rule_priced_with_change_rate/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- [Camptocamp](https://www.camptocamp.com) + - Camille Morand \<\> diff --git a/pos_barcode_rule_priced_with_change_rate/readme/CREDITS.md b/pos_barcode_rule_priced_with_change_rate/readme/CREDITS.md new file mode 100644 index 0000000000..970ef2f12c --- /dev/null +++ b/pos_barcode_rule_priced_with_change_rate/readme/CREDITS.md @@ -0,0 +1,2 @@ +The development was financially supported by Camptocamp. + diff --git a/pos_barcode_rule_priced_with_change_rate/readme/DESCRIPTION.md b/pos_barcode_rule_priced_with_change_rate/readme/DESCRIPTION.md new file mode 100644 index 0000000000..6694ddbbca --- /dev/null +++ b/pos_barcode_rule_priced_with_change_rate/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module adds a barcode rule to be able to scan a barcode with price encoded (as the standard "Priced Product" rule), and convert the price according to a given change rate diff --git a/pos_barcode_rule_priced_with_change_rate/static/src/overrides/components/product_screen/product_screen.esm.js b/pos_barcode_rule_priced_with_change_rate/static/src/overrides/components/product_screen/product_screen.esm.js new file mode 100644 index 0000000000..99bd79e1c8 --- /dev/null +++ b/pos_barcode_rule_priced_with_change_rate/static/src/overrides/components/product_screen/product_screen.esm.js @@ -0,0 +1,42 @@ +/** @odoo-module **/ + +import {ProductScreen} from "@point_of_sale/app/screens/product_screen/product_screen"; +import {useBarcodeReader} from "@point_of_sale/app/barcode/barcode_reader_hook"; +import {patch} from "@web/core/utils/patch"; +import {ConfirmPopup} from "@point_of_sale/app/utils/confirm_popup/confirm_popup"; +import {useService} from "@web/core/utils/hooks"; +import {ErrorBarcodePopup} from "@point_of_sale/app/barcode/error_popup/barcode_error_popup"; + +patch(ProductScreen.prototype, { + setup() { + super.setup(...arguments); + useBarcodeReader({ + price_change_rate: this._onPriceChangeRateScan, + }); + }, + + async _onPriceChangeRateScan(code) { + // Read the barcode the same way than it is done for the standard `price` type (cf. + // https://github.com/odoo/odoo/blob/17.0/addons/point_of_sale/static/src/app/screens/product_screen/product_screen.js#L257C1-L290C6), + // and convert the price according to the change rate in POS settings before returning it. + const product = await this._getProductByBarcode(code); + if (!product) { + return this.popup.add(ErrorBarcodePopup, {code: code.base_code}); + } + const options = await product.getAddProductOptions(code); + // Do not proceed on adding the product when no options is returned. + // This is consistent with clickProduct. + if (!options) { + return; + } + + Object.assign(options, { + price: code.value / this.pos.config.change_rate_barcode, + extras: { + price_type: "manual", + }, + }); + this.currentOrder.add_product(product, options); + this.numberBuffer.reset(); + }, +}); diff --git a/pos_barcode_rule_priced_with_change_rate/views/res_config_settings_views.xml b/pos_barcode_rule_priced_with_change_rate/views/res_config_settings_views.xml new file mode 100644 index 0000000000..bcdf92440d --- /dev/null +++ b/pos_barcode_rule_priced_with_change_rate/views/res_config_settings_views.xml @@ -0,0 +1,16 @@ + + + + + res.config.settings + + + +
+
+
+
+
+
From ab93af22d474d5964ea5a5c42327bd39e70353b8 Mon Sep 17 00:00:00 2001 From: trisdoan Date: Tue, 25 Mar 2025 17:42:42 +0700 Subject: [PATCH 02/10] [IMP] pos_barcode_rule_priced_with_change_rate: pre-commit execution --- .../README.rst | 85 ++++ .../models/barcode_rule.py | 9 +- .../models/pos_config.py | 2 +- .../models/res_config_settings.py | 6 +- .../static/description/index.html | 433 ++++++++++++++++++ .../views/res_config_settings_views.xml | 9 +- 6 files changed, 533 insertions(+), 11 deletions(-) create mode 100644 pos_barcode_rule_priced_with_change_rate/README.rst create mode 100644 pos_barcode_rule_priced_with_change_rate/static/description/index.html diff --git a/pos_barcode_rule_priced_with_change_rate/README.rst b/pos_barcode_rule_priced_with_change_rate/README.rst new file mode 100644 index 0000000000..8eddea386e --- /dev/null +++ b/pos_barcode_rule_priced_with_change_rate/README.rst @@ -0,0 +1,85 @@ +==================================================================== +Point of Sale - New barcode rule for priced product with change rate +==================================================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:ac77e3419d2de2d61295c1a36f96dd65e138863cde6747a64177b387aeeb88d7 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github + :target: https://github.com/OCA/pos/tree/18.0/pos_barcode_rule_priced_with_change_rate + :alt: OCA/pos +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/pos-18-0/pos-18-0-pos_barcode_rule_priced_with_change_rate + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds a barcode rule to be able to scan a barcode with price +encoded (as the standard "Priced Product" rule), and convert the price +according to a given change rate + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Camptocamp + +Contributors +------------ + +- `Camptocamp `__ + + - Camille Morand + +Other credits +------------- + +The development was financially supported by Camptocamp. + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/pos `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/pos_barcode_rule_priced_with_change_rate/models/barcode_rule.py b/pos_barcode_rule_priced_with_change_rate/models/barcode_rule.py index 099ca2cb0f..fc8b91be8f 100644 --- a/pos_barcode_rule_priced_with_change_rate/models/barcode_rule.py +++ b/pos_barcode_rule_priced_with_change_rate/models/barcode_rule.py @@ -1,10 +1,13 @@ # Copyright 2024 Camptocamp SA (https://www.camptocamp.com). # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from odoo import models, fields +from odoo import fields, models class BarcodeRule(models.Model): - _inherit = 'barcode.rule' + _inherit = "barcode.rule" - type = fields.Selection(selection_add=[('price_change_rate', 'Priced Product with Change Rate')], ondelete={'price_change_rate': 'set default'}) + type = fields.Selection( + selection_add=[("price_change_rate", "Priced Product with Change Rate")], + ondelete={"price_change_rate": "set default"}, + ) diff --git a/pos_barcode_rule_priced_with_change_rate/models/pos_config.py b/pos_barcode_rule_priced_with_change_rate/models/pos_config.py index 3cad6785c3..cb5a0ad9db 100644 --- a/pos_barcode_rule_priced_with_change_rate/models/pos_config.py +++ b/pos_barcode_rule_priced_with_change_rate/models/pos_config.py @@ -5,6 +5,6 @@ class PosConfig(models.Model): - _inherit = 'pos.config' + _inherit = "pos.config" change_rate_barcode = fields.Float(string="Change rate for barcode nomenclature") diff --git a/pos_barcode_rule_priced_with_change_rate/models/res_config_settings.py b/pos_barcode_rule_priced_with_change_rate/models/res_config_settings.py index e44a8a0c3d..2d14aa4ef3 100644 --- a/pos_barcode_rule_priced_with_change_rate/models/res_config_settings.py +++ b/pos_barcode_rule_priced_with_change_rate/models/res_config_settings.py @@ -5,6 +5,8 @@ class ResConfigSettings(models.TransientModel): - _inherit = 'res.config.settings' + _inherit = "res.config.settings" - change_rate_barcode = fields.Float(related="pos_config_id.change_rate_barcode", readonly=False) + change_rate_barcode = fields.Float( + related="pos_config_id.change_rate_barcode", readonly=False + ) diff --git a/pos_barcode_rule_priced_with_change_rate/static/description/index.html b/pos_barcode_rule_priced_with_change_rate/static/description/index.html new file mode 100644 index 0000000000..7903419398 --- /dev/null +++ b/pos_barcode_rule_priced_with_change_rate/static/description/index.html @@ -0,0 +1,433 @@ + + + + + +Point of Sale - New barcode rule for priced product with change rate + + + +
+

Point of Sale - New barcode rule for priced product with change rate

+ + +

Beta License: AGPL-3 OCA/pos Translate me on Weblate Try me on Runboat

+

This module adds a barcode rule to be able to scan a barcode with price +encoded (as the standard “Priced Product” rule), and convert the price +according to a given change rate

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Camptocamp
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The development was financially supported by Camptocamp.

+
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/pos project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/pos_barcode_rule_priced_with_change_rate/views/res_config_settings_views.xml b/pos_barcode_rule_priced_with_change_rate/views/res_config_settings_views.xml index bcdf92440d..cd8fec5e30 100644 --- a/pos_barcode_rule_priced_with_change_rate/views/res_config_settings_views.xml +++ b/pos_barcode_rule_priced_with_change_rate/views/res_config_settings_views.xml @@ -1,14 +1,13 @@ - + - res.config.settings - +
-
From 64a4167f2c9dd0a0f081b4ffb4db2b3d3eea06e4 Mon Sep 17 00:00:00 2001 From: trisdoan Date: Tue, 25 Mar 2025 17:42:42 +0700 Subject: [PATCH 03/10] [MIG] pos_barcode_rule_priced_with_change_rate: Migration to 18.0 --- .../README.rst | 7 ++++- .../__manifest__.py | 2 +- .../readme/CONTRIBUTORS.md | 2 ++ .../readme/CREDITS.md | 2 +- .../static/description/index.html | 7 ++++- .../product_screen/product_screen.esm.js | 28 ++++++------------- 6 files changed, 25 insertions(+), 23 deletions(-) diff --git a/pos_barcode_rule_priced_with_change_rate/README.rst b/pos_barcode_rule_priced_with_change_rate/README.rst index 8eddea386e..fd3c88acaa 100644 --- a/pos_barcode_rule_priced_with_change_rate/README.rst +++ b/pos_barcode_rule_priced_with_change_rate/README.rst @@ -62,10 +62,15 @@ Contributors - Camille Morand +- Trobz + + - Tris Doan + Other credits ------------- -The development was financially supported by Camptocamp. +The development and migration of this module from 17.0 to 18.0 was +financially supported by Camptocamp. Maintainers ----------- diff --git a/pos_barcode_rule_priced_with_change_rate/__manifest__.py b/pos_barcode_rule_priced_with_change_rate/__manifest__.py index f1bb1062b6..29f275b44e 100644 --- a/pos_barcode_rule_priced_with_change_rate/__manifest__.py +++ b/pos_barcode_rule_priced_with_change_rate/__manifest__.py @@ -1,6 +1,6 @@ { "name": "Point of Sale - New barcode rule for priced product with change rate", - "version": "17.0.1.0.0", + "version": "18.0.1.0.0", "category": "Sales/Point of Sale", "summary": """ Add a barcode rule to be able to scan a barcode with price encoded (as the diff --git a/pos_barcode_rule_priced_with_change_rate/readme/CONTRIBUTORS.md b/pos_barcode_rule_priced_with_change_rate/readme/CONTRIBUTORS.md index 7b7784d15b..3d72481402 100644 --- a/pos_barcode_rule_priced_with_change_rate/readme/CONTRIBUTORS.md +++ b/pos_barcode_rule_priced_with_change_rate/readme/CONTRIBUTORS.md @@ -1,2 +1,4 @@ - [Camptocamp](https://www.camptocamp.com) - Camille Morand \<\> +- Trobz + - Tris Doan \<\> diff --git a/pos_barcode_rule_priced_with_change_rate/readme/CREDITS.md b/pos_barcode_rule_priced_with_change_rate/readme/CREDITS.md index 970ef2f12c..8e745b3fc5 100644 --- a/pos_barcode_rule_priced_with_change_rate/readme/CREDITS.md +++ b/pos_barcode_rule_priced_with_change_rate/readme/CREDITS.md @@ -1,2 +1,2 @@ -The development was financially supported by Camptocamp. +The development and migration of this module from 17.0 to 18.0 was financially supported by Camptocamp. diff --git a/pos_barcode_rule_priced_with_change_rate/static/description/index.html b/pos_barcode_rule_priced_with_change_rate/static/description/index.html index 7903419398..9cd977c82c 100644 --- a/pos_barcode_rule_priced_with_change_rate/static/description/index.html +++ b/pos_barcode_rule_priced_with_change_rate/static/description/index.html @@ -409,11 +409,16 @@

Contributors

  • Camille Morand
  • +
  • Trobz +
  • Other credits

    -

    The development was financially supported by Camptocamp.

    +

    The development and migration of this module from 17.0 to 18.0 was +financially supported by Camptocamp.

    Maintainers

    diff --git a/pos_barcode_rule_priced_with_change_rate/static/src/overrides/components/product_screen/product_screen.esm.js b/pos_barcode_rule_priced_with_change_rate/static/src/overrides/components/product_screen/product_screen.esm.js index 99bd79e1c8..565ebfec56 100644 --- a/pos_barcode_rule_priced_with_change_rate/static/src/overrides/components/product_screen/product_screen.esm.js +++ b/pos_barcode_rule_priced_with_change_rate/static/src/overrides/components/product_screen/product_screen.esm.js @@ -1,11 +1,6 @@ -/** @odoo-module **/ - import {ProductScreen} from "@point_of_sale/app/screens/product_screen/product_screen"; import {useBarcodeReader} from "@point_of_sale/app/barcode/barcode_reader_hook"; import {patch} from "@web/core/utils/patch"; -import {ConfirmPopup} from "@point_of_sale/app/utils/confirm_popup/confirm_popup"; -import {useService} from "@web/core/utils/hooks"; -import {ErrorBarcodePopup} from "@point_of_sale/app/barcode/error_popup/barcode_error_popup"; patch(ProductScreen.prototype, { setup() { @@ -16,27 +11,22 @@ patch(ProductScreen.prototype, { }, async _onPriceChangeRateScan(code) { - // Read the barcode the same way than it is done for the standard `price` type (cf. - // https://github.com/odoo/odoo/blob/17.0/addons/point_of_sale/static/src/app/screens/product_screen/product_screen.js#L257C1-L290C6), + // Read the barcode the same way than it is done for the standard `price` type // and convert the price according to the change rate in POS settings before returning it. const product = await this._getProductByBarcode(code); if (!product) { - return this.popup.add(ErrorBarcodePopup, {code: code.base_code}); - } - const options = await product.getAddProductOptions(code); - // Do not proceed on adding the product when no options is returned. - // This is consistent with clickProduct. - if (!options) { + this.barcodeReader.showNotFoundNotification(code); return; } - Object.assign(options, { - price: code.value / this.pos.config.change_rate_barcode, - extras: { - price_type: "manual", + await this.pos.addLineToCurrentOrder( + { + product_id: product, + price_unit: code.value / this.pos.config.change_rate_barcode, }, - }); - this.currentOrder.add_product(product, options); + {code}, + product.needToConfigure() + ); this.numberBuffer.reset(); }, }); From 431f8b72fdf1a631d9810cb6bb0c2f81caff2b70 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Wed, 9 Apr 2025 13:47:48 +0000 Subject: [PATCH 04/10] [UPD] Update pos_barcode_rule_priced_with_change_rate.pot --- .../i18n/pos_barcode_rule_priced_with_change_rate.pot | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pos_barcode_rule_priced_with_change_rate/i18n/pos_barcode_rule_priced_with_change_rate.pot b/pos_barcode_rule_priced_with_change_rate/i18n/pos_barcode_rule_priced_with_change_rate.pot index b6c5a391c0..c9ec319965 100644 --- a/pos_barcode_rule_priced_with_change_rate/i18n/pos_barcode_rule_priced_with_change_rate.pot +++ b/pos_barcode_rule_priced_with_change_rate/i18n/pos_barcode_rule_priced_with_change_rate.pot @@ -4,10 +4,8 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 17.0+e\n" +"Project-Id-Version: Odoo Server 18.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-03-25 11:07+0000\n" -"PO-Revision-Date: 2025-03-25 11:07+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" From a5c443a364624f5bf5ba2831daaac95e16966747 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Wed, 9 Apr 2025 13:50:57 +0000 Subject: [PATCH 05/10] [BOT] post-merge updates --- .../README.rst | 10 +++++----- .../static/description/icon.png | Bin 0 -> 10254 bytes .../static/description/index.html | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 pos_barcode_rule_priced_with_change_rate/static/description/icon.png diff --git a/pos_barcode_rule_priced_with_change_rate/README.rst b/pos_barcode_rule_priced_with_change_rate/README.rst index fd3c88acaa..08dd35cdd0 100644 --- a/pos_barcode_rule_priced_with_change_rate/README.rst +++ b/pos_barcode_rule_priced_with_change_rate/README.rst @@ -7,7 +7,7 @@ Point of Sale - New barcode rule for priced product with change rate !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:ac77e3419d2de2d61295c1a36f96dd65e138863cde6747a64177b387aeeb88d7 + !! source digest: sha256:192992f062cf4d853314d5449c8b17956297013eeef789166cec6b4bfd062789 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png @@ -58,13 +58,13 @@ Authors Contributors ------------ -- `Camptocamp `__ +- `Camptocamp `__ - - Camille Morand + - Camille Morand -- Trobz +- Trobz - - Tris Doan + - Tris Doan Other credits ------------- diff --git a/pos_barcode_rule_priced_with_change_rate/static/description/icon.png b/pos_barcode_rule_priced_with_change_rate/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..1dcc49c24f364e9adf0afbc6fc0bac6dbecdeb11 GIT binary patch literal 10254 zcmbt)WmufcvhH9Zc!C8B?l8#UE&&o;gF7=g3=D(IAOS+K1lK^25Zv7%L4sRw_uvvF z*qyAk?>c**=lnR&y+1yw{;I3Hy6Ua2{<d0kcR+VvBo; zA_X`>;1;xAPL9rQqFxd#f5{a^zW*uaW+r3+U{|fRunu`GZhy$X z8_|Zi{zd#vIokczl8Xh*4Wi@i0+C?Rg1AB5VOEg8B>buLFCi~r5DPd2ED7QP2>^LO zKpr7+?*I1bPaFSLLEa0l2$tj*;u8Qtc=&(RUc*VK@ zjIN{I--GfO@vl+&r^eqy_BZ3dndN_PDzMc*W^!?dIsWAWU@LBjBg6^f4F6*!-hUYh zY$Xb}gF8b0%S1Ac@c%Rs()UCiEu3v6SiFE>h_!{gBb-H2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qnlYtPHBk#X&2}r7`@K`J@^e~Qm?iRJ*tbAaZDZTmB&mWMkZp7Kj7^kth#_uX z5z>gC(8Xz|Ie(+#&wiF3;Aey|Db(R*-U)!6;l_5@u?-$>j0SgEl5+c}Lfe-$p-dFH zB_$bC<)x6#A_2Uuo8=^l1@}vK!gvbF#b&MoH8ac3xMxUz$LFb8KU(x$YhtHanM_sw zYOFMBX2iNNSe&a}!;G9nv(tsW4@%3iQcqczOCF*JOBQ@4Orw=o?_vc(9$hfO`>U6& zyY_CUa9pASiJpmv`@oR!k;&$`h8!)$uS=}d-fPddfIdMDUW@%3y1LI(1Q=e$)sz(QC*E;Nfl99YTgk+|@jl`+iF?<_D?4YqV0Zl)lO8YWC@1ZWW^mi{5ePQN<~FQ2NMG$|K{py5akJa zkezmqhN)>MGMp$7=sOo2(7ppv``dCIwf&MaQQis7S596kkiw8Do(jO?EY4iJ4Hec6 z4Hymzu`w)cI9Pbq6GPtTP)x&Lmk;FT=ZCB4>(5}c0?;2l`p&?>&<;2(P8a3lOTNP# zdEzF5qDpkRR&PZC&cS{7xD@qV;(g5X%xI?m$9QPoint of Sale - New barcode rule for priced product with chang !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:ac77e3419d2de2d61295c1a36f96dd65e138863cde6747a64177b387aeeb88d7 +!! source digest: sha256:192992f062cf4d853314d5449c8b17956297013eeef789166cec6b4bfd062789 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

    Beta License: AGPL-3 OCA/pos Translate me on Weblate Try me on Runboat

    This module adds a barcode rule to be able to scan a barcode with price @@ -406,7 +406,7 @@

    Authors

    Contributors

    • Camptocamp
    • Trobz
        From 3c0450b4397b1e14efe67c1267d0315b5fa73584 Mon Sep 17 00:00:00 2001 From: mymage Date: Fri, 11 Apr 2025 14:17:01 +0000 Subject: [PATCH 06/10] Added translation using Weblate (Italian) --- .../i18n/it.po | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 pos_barcode_rule_priced_with_change_rate/i18n/it.po diff --git a/pos_barcode_rule_priced_with_change_rate/i18n/it.po b/pos_barcode_rule_priced_with_change_rate/i18n/it.po new file mode 100644 index 0000000000..7a8bcb0c01 --- /dev/null +++ b/pos_barcode_rule_priced_with_change_rate/i18n/it.po @@ -0,0 +1,46 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_barcode_rule_priced_with_change_rate +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#. module: pos_barcode_rule_priced_with_change_rate +#: model:ir.model,name:pos_barcode_rule_priced_with_change_rate.model_barcode_rule +msgid "Barcode Rule" +msgstr "" + +#. module: pos_barcode_rule_priced_with_change_rate +#: model:ir.model.fields,field_description:pos_barcode_rule_priced_with_change_rate.field_pos_config__change_rate_barcode +#: model:ir.model.fields,field_description:pos_barcode_rule_priced_with_change_rate.field_res_config_settings__change_rate_barcode +msgid "Change rate for barcode nomenclature" +msgstr "" + +#. module: pos_barcode_rule_priced_with_change_rate +#: model:ir.model,name:pos_barcode_rule_priced_with_change_rate.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: pos_barcode_rule_priced_with_change_rate +#: model:ir.model,name:pos_barcode_rule_priced_with_change_rate.model_pos_config +msgid "Point of Sale Configuration" +msgstr "" + +#. module: pos_barcode_rule_priced_with_change_rate +#: model:ir.model.fields.selection,name:pos_barcode_rule_priced_with_change_rate.selection__barcode_rule__type__price_change_rate +msgid "Priced Product with Change Rate" +msgstr "" + +#. module: pos_barcode_rule_priced_with_change_rate +#: model:ir.model.fields,field_description:pos_barcode_rule_priced_with_change_rate.field_barcode_rule__type +msgid "Type" +msgstr "" From d6faf1af772fe09f50325b82421b24f64ed50add Mon Sep 17 00:00:00 2001 From: mymage Date: Fri, 11 Apr 2025 14:17:12 +0000 Subject: [PATCH 07/10] Translated using Weblate (Italian) Currently translated at 100.0% (6 of 6 strings) Translation: pos-18.0/pos-18.0-pos_barcode_rule_priced_with_change_rate Translate-URL: https://translation.odoo-community.org/projects/pos-18-0/pos-18-0-pos_barcode_rule_priced_with_change_rate/it/ --- .../i18n/it.po | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pos_barcode_rule_priced_with_change_rate/i18n/it.po b/pos_barcode_rule_priced_with_change_rate/i18n/it.po index 7a8bcb0c01..7eec09e077 100644 --- a/pos_barcode_rule_priced_with_change_rate/i18n/it.po +++ b/pos_barcode_rule_priced_with_change_rate/i18n/it.po @@ -6,41 +6,43 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 18.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2025-04-11 14:54+0000\n" +"Last-Translator: mymage \n" "Language-Team: none\n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.10.4\n" #. module: pos_barcode_rule_priced_with_change_rate #: model:ir.model,name:pos_barcode_rule_priced_with_change_rate.model_barcode_rule msgid "Barcode Rule" -msgstr "" +msgstr "Regola codice a barre" #. module: pos_barcode_rule_priced_with_change_rate #: model:ir.model.fields,field_description:pos_barcode_rule_priced_with_change_rate.field_pos_config__change_rate_barcode #: model:ir.model.fields,field_description:pos_barcode_rule_priced_with_change_rate.field_res_config_settings__change_rate_barcode msgid "Change rate for barcode nomenclature" -msgstr "" +msgstr "Tasso di cambio per la nomenclatura codice a barre" #. module: pos_barcode_rule_priced_with_change_rate #: model:ir.model,name:pos_barcode_rule_priced_with_change_rate.model_res_config_settings msgid "Config Settings" -msgstr "" +msgstr "Impostazioni configurazione" #. module: pos_barcode_rule_priced_with_change_rate #: model:ir.model,name:pos_barcode_rule_priced_with_change_rate.model_pos_config msgid "Point of Sale Configuration" -msgstr "" +msgstr "Configurazione punto vendita" #. module: pos_barcode_rule_priced_with_change_rate #: model:ir.model.fields.selection,name:pos_barcode_rule_priced_with_change_rate.selection__barcode_rule__type__price_change_rate msgid "Priced Product with Change Rate" -msgstr "" +msgstr "Prodotto prezzato con tasso di cambio" #. module: pos_barcode_rule_priced_with_change_rate #: model:ir.model.fields,field_description:pos_barcode_rule_priced_with_change_rate.field_barcode_rule__type msgid "Type" -msgstr "" +msgstr "Tipo" From 11cbcb9f1856629f237296a5905b82f645e8bd27 Mon Sep 17 00:00:00 2001 From: Nirav Rathod Date: Mon, 18 May 2026 04:50:31 +0000 Subject: [PATCH 08/10] [IMP] pos_barcode_rule_priced_with_change_rate: black, isort, prettier --- .../README.rst | 16 ++++++---- .../__manifest__.py | 2 +- .../static/description/index.html | 30 +++++++++++-------- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/pos_barcode_rule_priced_with_change_rate/README.rst b/pos_barcode_rule_priced_with_change_rate/README.rst index 08dd35cdd0..fb3fa76118 100644 --- a/pos_barcode_rule_priced_with_change_rate/README.rst +++ b/pos_barcode_rule_priced_with_change_rate/README.rst @@ -1,3 +1,7 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + ==================================================================== Point of Sale - New barcode rule for priced product with change rate ==================================================================== @@ -13,17 +17,17 @@ Point of Sale - New barcode rule for priced product with change rate .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status :alt: Beta -.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github - :target: https://github.com/OCA/pos/tree/18.0/pos_barcode_rule_priced_with_change_rate + :target: https://github.com/OCA/pos/tree/19.0/pos_barcode_rule_priced_with_change_rate :alt: OCA/pos .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/pos-18-0/pos-18-0-pos_barcode_rule_priced_with_change_rate + :target: https://translation.odoo-community.org/projects/pos-19-0/pos-19-0-pos_barcode_rule_priced_with_change_rate :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=18.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=19.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -43,7 +47,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -85,6 +89,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/pos `_ project on GitHub. +This module is part of the `OCA/pos `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/pos_barcode_rule_priced_with_change_rate/__manifest__.py b/pos_barcode_rule_priced_with_change_rate/__manifest__.py index 29f275b44e..bccd3d8488 100644 --- a/pos_barcode_rule_priced_with_change_rate/__manifest__.py +++ b/pos_barcode_rule_priced_with_change_rate/__manifest__.py @@ -1,6 +1,6 @@ { "name": "Point of Sale - New barcode rule for priced product with change rate", - "version": "18.0.1.0.0", + "version": "19.0.1.0.0", "category": "Sales/Point of Sale", "summary": """ Add a barcode rule to be able to scan a barcode with price encoded (as the diff --git a/pos_barcode_rule_priced_with_change_rate/static/description/index.html b/pos_barcode_rule_priced_with_change_rate/static/description/index.html index a0b45fe0b6..8d5bdece59 100644 --- a/pos_barcode_rule_priced_with_change_rate/static/description/index.html +++ b/pos_barcode_rule_priced_with_change_rate/static/description/index.html @@ -3,7 +3,7 @@ -Point of Sale - New barcode rule for priced product with change rate +README.rst -
        -

        Point of Sale - New barcode rule for priced product with change rate

        +
        + + +Odoo Community Association + +
        +

        Point of Sale - New barcode rule for priced product with change rate

        -

        Beta License: AGPL-3 OCA/pos Translate me on Weblate Try me on Runboat

        +

        Beta License: AGPL-3 OCA/pos Translate me on Weblate Try me on Runboat

        This module adds a barcode rule to be able to scan a barcode with price encoded (as the standard “Priced Product” rule), and convert the price according to a given change rate

        @@ -387,23 +392,23 @@

        Point of Sale - New barcode rule for priced product with chang

    -

    Bug Tracker

    +

    Bug Tracker

    Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

    +feedback.

    Do not contact contributors directly about support or help with technical issues.

    -

    Credits

    +

    Credits

    -

    Authors

    +

    Authors

    • Camptocamp
    -

    Other credits

    +

    Other credits

    The development and migration of this module from 17.0 to 18.0 was financially supported by Camptocamp.

    -

    Maintainers

    +

    Maintainers

    This module is maintained by the OCA.

    Odoo Community Association @@ -429,10 +434,11 @@

    Maintainers

    OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

    -

    This module is part of the OCA/pos project on GitHub.

    +

    This module is part of the OCA/pos project on GitHub.

    You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

    + From f73a0a632dcf4623b71a59367467ecf8593d6a47 Mon Sep 17 00:00:00 2001 From: Nirav Rathod Date: Mon, 18 May 2026 05:14:57 +0000 Subject: [PATCH 09/10] [MIG] pos_barcode_rule_priced_with_change_rate: Migration to 19.0 --- .../README.rst | 25 ++++++++------- .../__manifest__.py | 1 + .../models/pos_config.py | 7 +++- .../readme/CONTRIBUTORS.md | 12 ++++--- .../readme/CREDITS.md | 2 -- .../readme/DESCRIPTION.md | 4 ++- .../static/description/index.html | 22 +++++++------ .../product_screen/product_screen.esm.js | 32 ++++++++++++++++--- .../static/src/tours/pos_barcode_tour.esm.js | 23 +++++++++++++ .../views/res_config_settings_views.xml | 9 +++++- 10 files changed, 103 insertions(+), 34 deletions(-) create mode 100644 pos_barcode_rule_priced_with_change_rate/static/src/tours/pos_barcode_tour.esm.js diff --git a/pos_barcode_rule_priced_with_change_rate/README.rst b/pos_barcode_rule_priced_with_change_rate/README.rst index fb3fa76118..f71787740a 100644 --- a/pos_barcode_rule_priced_with_change_rate/README.rst +++ b/pos_barcode_rule_priced_with_change_rate/README.rst @@ -11,12 +11,12 @@ Point of Sale - New barcode rule for priced product with change rate !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:192992f062cf4d853314d5449c8b17956297013eeef789166cec6b4bfd062789 + !! source digest: sha256:069fed6da59ff6b394529bafc4c3dcea82432135a03d961bc393f7b6daa2f261 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png +.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png :target: https://odoo-community.org/page/development-status - :alt: Beta + :alt: Production/Stable .. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 @@ -32,9 +32,9 @@ Point of Sale - New barcode rule for priced product with change rate |badge1| |badge2| |badge3| |badge4| |badge5| -This module adds a barcode rule to be able to scan a barcode with price -encoded (as the standard "Priced Product" rule), and convert the price -according to a given change rate +This module adds a barcode rule to allow scanning barcodes with encoded +prices, similar to the standard "Priced Product" rule, while converting +the price according to a configured exchange rate. **Table of contents** @@ -62,19 +62,22 @@ Authors Contributors ------------ -- `Camptocamp `__ +- Camptocamp - - Camille Morand + - Camille Morand camille.morand@camptocamp.com - Trobz - - Tris Doan + - Tris Doan tridm@trobz.com + +- Niravrathod + + - Nirav Rathod niravrathod473@gmail.com Other credits ------------- -The development and migration of this module from 17.0 to 18.0 was -financially supported by Camptocamp. + Maintainers ----------- diff --git a/pos_barcode_rule_priced_with_change_rate/__manifest__.py b/pos_barcode_rule_priced_with_change_rate/__manifest__.py index bccd3d8488..2a8164c752 100644 --- a/pos_barcode_rule_priced_with_change_rate/__manifest__.py +++ b/pos_barcode_rule_priced_with_change_rate/__manifest__.py @@ -18,4 +18,5 @@ }, "installable": True, "license": "AGPL-3", + "development_status": "Production/Stable", } diff --git a/pos_barcode_rule_priced_with_change_rate/models/pos_config.py b/pos_barcode_rule_priced_with_change_rate/models/pos_config.py index cb5a0ad9db..c40f5b1934 100644 --- a/pos_barcode_rule_priced_with_change_rate/models/pos_config.py +++ b/pos_barcode_rule_priced_with_change_rate/models/pos_config.py @@ -7,4 +7,9 @@ class PosConfig(models.Model): _inherit = "pos.config" - change_rate_barcode = fields.Float(string="Change rate for barcode nomenclature") + change_rate_barcode = fields.Float( + string="Change rate for barcode nomenclature", + help="Conversion rate applied to the price encoded in a barcode " + "when using the 'Priced Product with Change Rate' rule. " + "The scanned price is divided by this rate.", + ) diff --git a/pos_barcode_rule_priced_with_change_rate/readme/CONTRIBUTORS.md b/pos_barcode_rule_priced_with_change_rate/readme/CONTRIBUTORS.md index 3d72481402..41dd5ee3f0 100644 --- a/pos_barcode_rule_priced_with_change_rate/readme/CONTRIBUTORS.md +++ b/pos_barcode_rule_priced_with_change_rate/readme/CONTRIBUTORS.md @@ -1,4 +1,8 @@ -- [Camptocamp](https://www.camptocamp.com) - - Camille Morand \<\> -- Trobz - - Tris Doan \<\> +- Camptocamp + - Camille Morand + +- Trobz + - Tris Doan + +- Niravrathod + - Nirav Rathod \ No newline at end of file diff --git a/pos_barcode_rule_priced_with_change_rate/readme/CREDITS.md b/pos_barcode_rule_priced_with_change_rate/readme/CREDITS.md index 8e745b3fc5..e69de29bb2 100644 --- a/pos_barcode_rule_priced_with_change_rate/readme/CREDITS.md +++ b/pos_barcode_rule_priced_with_change_rate/readme/CREDITS.md @@ -1,2 +0,0 @@ -The development and migration of this module from 17.0 to 18.0 was financially supported by Camptocamp. - diff --git a/pos_barcode_rule_priced_with_change_rate/readme/DESCRIPTION.md b/pos_barcode_rule_priced_with_change_rate/readme/DESCRIPTION.md index 6694ddbbca..233b6e91f7 100644 --- a/pos_barcode_rule_priced_with_change_rate/readme/DESCRIPTION.md +++ b/pos_barcode_rule_priced_with_change_rate/readme/DESCRIPTION.md @@ -1 +1,3 @@ -This module adds a barcode rule to be able to scan a barcode with price encoded (as the standard "Priced Product" rule), and convert the price according to a given change rate +This module adds a barcode rule to allow scanning barcodes with encoded prices, +similar to the standard "Priced Product" rule, while converting the price +according to a configured exchange rate. diff --git a/pos_barcode_rule_priced_with_change_rate/static/description/index.html b/pos_barcode_rule_priced_with_change_rate/static/description/index.html index 8d5bdece59..185cd4f408 100644 --- a/pos_barcode_rule_priced_with_change_rate/static/description/index.html +++ b/pos_barcode_rule_priced_with_change_rate/static/description/index.html @@ -372,12 +372,12 @@

    Point of Sale - New barcode rule for priced product with change rate

    !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:192992f062cf4d853314d5449c8b17956297013eeef789166cec6b4bfd062789 +!! source digest: sha256:069fed6da59ff6b394529bafc4c3dcea82432135a03d961bc393f7b6daa2f261 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

    Beta License: AGPL-3 OCA/pos Translate me on Weblate Try me on Runboat

    -

    This module adds a barcode rule to be able to scan a barcode with price -encoded (as the standard “Priced Product” rule), and convert the price -according to a given change rate

    +

    Production/Stable License: AGPL-3 OCA/pos Translate me on Weblate Try me on Runboat

    +

    This module adds a barcode rule to allow scanning barcodes with encoded +prices, similar to the standard “Priced Product” rule, while converting +the price according to a configured exchange rate.

    Table of contents

      @@ -410,20 +410,22 @@

      Authors

      Contributors

      Other credits

      -

      The development and migration of this module from 17.0 to 18.0 was -financially supported by Camptocamp.

      Maintainers

      diff --git a/pos_barcode_rule_priced_with_change_rate/static/src/overrides/components/product_screen/product_screen.esm.js b/pos_barcode_rule_priced_with_change_rate/static/src/overrides/components/product_screen/product_screen.esm.js index 565ebfec56..c1e18410d2 100644 --- a/pos_barcode_rule_priced_with_change_rate/static/src/overrides/components/product_screen/product_screen.esm.js +++ b/pos_barcode_rule_priced_with_change_rate/static/src/overrides/components/product_screen/product_screen.esm.js @@ -1,6 +1,9 @@ +// Copyright 2024 Camptocamp SA (https://www.camptocamp.com). +// License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + import {ProductScreen} from "@point_of_sale/app/screens/product_screen/product_screen"; -import {useBarcodeReader} from "@point_of_sale/app/barcode/barcode_reader_hook"; import {patch} from "@web/core/utils/patch"; +import {useBarcodeReader} from "@point_of_sale/app/hooks/barcode_reader_hook"; patch(ProductScreen.prototype, { setup() { @@ -10,23 +13,44 @@ patch(ProductScreen.prototype, { }); }, + /** + * Handle barcode scan for "Priced Product with Change Rate" rule. + * + * Reads the barcode the same way as the standard `price` type, + * then converts the encoded price according to the change rate + * configured in the POS settings before adding the product + * to the current order. + * + * @param {Object} code - Parsed barcode object from the nomenclature. + */ async _onPriceChangeRateScan(code) { - // Read the barcode the same way than it is done for the standard `price` type - // and convert the price according to the change rate in POS settings before returning it. const product = await this._getProductByBarcode(code); + if (!product) { + this.sound.play("scan-error"); this.barcodeReader.showNotFoundNotification(code); return; } + const rate = this.pos.config.change_rate_barcode; + if (!rate || rate <= 0) { + this.sound.play("scan-error"); + return; + } + + this.sound.play("beep"); + const price = this.env.utils.roundCurrency(code.value / rate); + await this.pos.addLineToCurrentOrder( { product_id: product, - price_unit: code.value / this.pos.config.change_rate_barcode, + product_tmpl_id: product.product_tmpl_id, + price_unit: price, }, {code}, product.needToConfigure() ); this.numberBuffer.reset(); + this.showOptionalProductPopupIfNeeded(product); }, }); diff --git a/pos_barcode_rule_priced_with_change_rate/static/src/tours/pos_barcode_tour.esm.js b/pos_barcode_rule_priced_with_change_rate/static/src/tours/pos_barcode_tour.esm.js new file mode 100644 index 0000000000..360466c139 --- /dev/null +++ b/pos_barcode_rule_priced_with_change_rate/static/src/tours/pos_barcode_tour.esm.js @@ -0,0 +1,23 @@ +import {registry} from "@web/core/registry"; + +registry.category("web_tour.tours").add("pos_barcode_change_rate_tour", { + url: "/pos/ui", + steps: () => [ + { + content: "Wait for POS to load", + trigger: ".pos-content", + run: () => null, + }, + // We simulate a barcode scan by sending a barcode event manually or + // using the barcode service mock if available in tests. + // For simplicity, this is a placeholder for the scan interaction. + { + content: "Mock barcode scan", + trigger: ".pos-content", + run: function () { + // Logic to trigger a barcode event with type 'price_change_rate' + console.log("Simulating barcode scan in tour..."); + }, + }, + ], +}); diff --git a/pos_barcode_rule_priced_with_change_rate/views/res_config_settings_views.xml b/pos_barcode_rule_priced_with_change_rate/views/res_config_settings_views.xml index cd8fec5e30..615fdba968 100644 --- a/pos_barcode_rule_priced_with_change_rate/views/res_config_settings_views.xml +++ b/pos_barcode_rule_priced_with_change_rate/views/res_config_settings_views.xml @@ -1,12 +1,19 @@ + res.config.settings.view.form.inherit.pos_barcode_rule_priced_with_change_rate res.config.settings
      -
      From 9a5c859fe64784efde3457ab6edf6c4f0022bff0 Mon Sep 17 00:00:00 2001 From: niravrathod Date: Wed, 27 May 2026 22:01:45 +0530 Subject: [PATCH 10/10] refactor: remove redundant console.log from tour --- .../static/src/tours/pos_barcode_tour.esm.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pos_barcode_rule_priced_with_change_rate/static/src/tours/pos_barcode_tour.esm.js b/pos_barcode_rule_priced_with_change_rate/static/src/tours/pos_barcode_tour.esm.js index 360466c139..70979d027a 100644 --- a/pos_barcode_rule_priced_with_change_rate/static/src/tours/pos_barcode_tour.esm.js +++ b/pos_barcode_rule_priced_with_change_rate/static/src/tours/pos_barcode_tour.esm.js @@ -14,10 +14,7 @@ registry.category("web_tour.tours").add("pos_barcode_change_rate_tour", { { content: "Mock barcode scan", trigger: ".pos-content", - run: function () { - // Logic to trigger a barcode event with type 'price_change_rate' - console.log("Simulating barcode scan in tour..."); - }, + run: () => null, }, ], });