diff --git a/pos_price_to_weight/README.rst b/pos_price_to_weight/README.rst deleted file mode 100644 index 82f9a458..00000000 --- a/pos_price_to_weight/README.rst +++ /dev/null @@ -1,105 +0,0 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - -=============================== -Point of Sale - Price to Weight -=============================== - -This module extends Odoo Point Of Sale features, to allow to scan barcode -with price and to compute according quantity. - -In Odoo by default, there are three types of barcode rules for products. - -* 'Unit Product' (type='product'). Scanning a product will add a unit of this - product to the current order. -* 'Priced product' (type='price'). A price is extracted from the barcode, and - a new line with the given price and a quantity = 1 is added to the current - order. -* 'Weighted product' (type='weight). A weight is extracted from the barcode, - and a new line with the given weight, and a computed price - (quantity * Unit price) is added to the current order. - -This module add a new option: - -* 'Priced Product (Computed Weight)' (type='price_to_weight'). A price is - extracted from the barcode, and a new line with the given price, and a - computed quantity (Price / Unit Price) is added to the current order. - -.. image:: /pos_price_to_weight/static/description/barcode_rule.png - :width: 800 px - -This module is usefull in shops with products scaled, to manage correctly -stock quantities. - -Samples - -* Given a product with a unit price of 1,50€ / kg -* The barcode is 0212345{NNNDD}x where: - * 02 is the prefix of the barcode rule - * 12345 is the product number - * {NNNDD} is the price of the scaled product - * x is the control digit - -if {NNNDD} is 00265, the price is so 2,65€ and the according quantity is -2,65€ / 1,5 €/kg = 1,767 kg - -.. image:: /pos_price_to_weight/static/description/pos_test_1.png - :width: 800 px - -if {NNNDD} is 00810, the price is so 8,10€ and the according quantity is -8,10€ / 1,5 €/kg = 5,400 kg - -.. image:: /pos_price_to_weight/static/description/pos_test_2.png - :width: 800 px - - -Configuration -============= - -* Go to 'Point of Sale' / 'Configuration' / 'Barcode Nomenclatures' -* Edit your barcode rules, according to your barcodes settings - -Usage -===== - -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/184/9.0 - -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 smash it by providing detailed and welcomed feedback. - -Credits -======= - -Images ------- - -Icon parts come from http://icons8.com - -Contributors ------------- - -* Sylvain LE GAL - - -Maintainer ----------- - -.. image:: https://odoo-community.org/logo.png - :alt: Odoo Community Association - :target: https://odoo-community.org - -This module is maintained by the OCA. - -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. - -To contribute to this module, please visit https://odoo-community.org. diff --git a/pos_price_to_weight/__init__.py b/pos_price_to_weight/__init__.py index a0fdc10f..0650744f 100644 --- a/pos_price_to_weight/__init__.py +++ b/pos_price_to_weight/__init__.py @@ -1,2 +1 @@ -# -*- coding: utf-8 -*- from . import models diff --git a/pos_price_to_weight/__manifest__.py b/pos_price_to_weight/__manifest__.py index 9a20874e..898349d7 100644 --- a/pos_price_to_weight/__manifest__.py +++ b/pos_price_to_weight/__manifest__.py @@ -1,11 +1,11 @@ -# -*- coding: utf-8 -*- # Copyright (C) 2017-Today: La Louve () +# Copyright (C) 2019-Today: Druidoo () # @author: Sylvain LE GAL (https://twitter.com/legalsylvain) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'Point of Sale - Price to Weight', - 'version': '10.0.1.0.0', + 'version': '11.0.1.0.0', 'category': 'Point Of Sale', 'summary': 'Compute weight based on barcodes with prices', 'author': 'La Louve, GRAP, Odoo Community Association (OCA)', @@ -16,7 +16,7 @@ ], 'data': [ 'data/barcode_rule.xml', - 'static/src/xml/templates.xml', + 'views/assets.xml', ], 'demo': [ 'demo/product_product.xml', diff --git a/pos_price_to_weight/models/__init__.py b/pos_price_to_weight/models/__init__.py index 7173a15c..ba6651a1 100644 --- a/pos_price_to_weight/models/__init__.py +++ b/pos_price_to_weight/models/__init__.py @@ -1,2 +1 @@ -# -*- coding: utf-8 -*- from . import barcode_rule diff --git a/pos_price_to_weight/models/barcode_rule.py b/pos_price_to_weight/models/barcode_rule.py index be66165b..e7baa5ce 100644 --- a/pos_price_to_weight/models/barcode_rule.py +++ b/pos_price_to_weight/models/barcode_rule.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (C) 2017-Today: La Louve () # @author: Sylvain LE GAL (https://twitter.com/legalsylvain) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/pos_price_to_weight/readme/CONFIGURE.rst b/pos_price_to_weight/readme/CONFIGURE.rst new file mode 100644 index 00000000..d1b66752 --- /dev/null +++ b/pos_price_to_weight/readme/CONFIGURE.rst @@ -0,0 +1,2 @@ +* Go to 'Point of Sale' / 'Configuration' / 'Barcode Nomenclatures' +* Edit your barcode rules, according to your barcodes settings diff --git a/pos_price_to_weight/readme/CONTRIBUTORS.rst b/pos_price_to_weight/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..61ae03c1 --- /dev/null +++ b/pos_price_to_weight/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Sylvain LE GAL +* Druidoo diff --git a/pos_price_to_weight/readme/CREDITS.rst b/pos_price_to_weight/readme/CREDITS.rst new file mode 100644 index 00000000..d8179e46 --- /dev/null +++ b/pos_price_to_weight/readme/CREDITS.rst @@ -0,0 +1 @@ +Icon parts come from http://icons8.com diff --git a/pos_price_to_weight/readme/DESCRIPTION.rst b/pos_price_to_weight/readme/DESCRIPTION.rst new file mode 100644 index 00000000..bab66fa2 --- /dev/null +++ b/pos_price_to_weight/readme/DESCRIPTION.rst @@ -0,0 +1,46 @@ +This module extends Odoo Point Of Sale features, to allow to scan barcode +with price and to compute according quantity. + +In Odoo by default, there are three types of barcode rules for products. + +* 'Unit Product' (type='product'). Scanning a product will add a unit of this + product to the current order. +* 'Priced product' (type='price'). A price is extracted from the barcode, and + a new line with the given price and a quantity = 1 is added to the current + order. +* 'Weighted product' (type='weight). A weight is extracted from the barcode, + and a new line with the given weight, and a computed price + (quantity * Unit price) is added to the current order. + +This module add a new option: + +* 'Priced Product (Computed Weight)' (type='price_to_weight'). A price is + extracted from the barcode, and a new line with the given price, and a + computed quantity (Price / Unit Price) is added to the current order. + +.. image:: ../static/description/barcode_rule.png + :width: 800 px + +This module is usefull in shops with products scaled, to manage correctly +stock quantities. + +Samples + +* Given a product with a unit price of 1,50€ / kg +* The barcode is 0212345{NNNDD}x where: + * 02 is the prefix of the barcode rule + * 12345 is the product number + * {NNNDD} is the price of the scaled product + * x is the control digit + +if {NNNDD} is 00265, the price is so 2,65€ and the according quantity is +2,65€ / 1,5 €/kg = 1,767 kg + +.. image:: ../static/description/pos_test_1.png + :width: 800 px + +if {NNNDD} is 00810, the price is so 8,10€ and the according quantity is +8,10€ / 1,5 €/kg = 5,400 kg + +.. image:: ../static/description/pos_test_2.png + :width: 800 px diff --git a/pos_price_to_weight/static/src/js/screens.js b/pos_price_to_weight/static/src/js/screens.js index 74ad0ce5..712af6db 100644 --- a/pos_price_to_weight/static/src/js/screens.js +++ b/pos_price_to_weight/static/src/js/screens.js @@ -19,4 +19,6 @@ odoo.define('pos_price_to_weight.screens', function (require) { }); }, }); + + return screens; }); diff --git a/pos_price_to_weight/static/src/xml/templates.xml b/pos_price_to_weight/views/assets.xml similarity index 99% rename from pos_price_to_weight/static/src/xml/templates.xml rename to pos_price_to_weight/views/assets.xml index 98da0a70..aad83cfc 100644 --- a/pos_price_to_weight/static/src/xml/templates.xml +++ b/pos_price_to_weight/views/assets.xml @@ -13,5 +13,3 @@ - -