Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0] MIG: pos_price_to_weight (from 12.0) #1146

Open
wants to merge 34 commits into
base: 16.0
Choose a base branch
from

Conversation

legalsylvain
Copy link
Contributor

Description

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.

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
  • On the product we so set '0212345000007' in the barcode field.

  • if the scanned barcode is 0212345002650:

    • {NNNDD} is 00265, the price is so 2,65€
    • the according quantity is 2,65€ / 1,5 €/kg = 1,767 kg

pos_test_1

  • if the scanned barcode is 0212345008102:
    • {NNNDD} is 00810, the price is so 8,10€
    • the according quantity is 8,10€ / 1,5 €/kg = 5,400 kg

pos_test_2

Configure

  • Go to Point of Sale > Configuration > Barcode Nomenclatures
  • Edit your barcode rules, according to your barcodes settings

barcode_rule

legalsylvain and others added 30 commits January 27, 2024 10:08
* [ADD] module pos_price_to_weight

* [FIX] jslint / pylint / flake8 issues
OCA Transbot updated translations from Transifex

OCA Transbot updated translations from Transifex

[UPD] Update pos_price_to_weight.pot
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: pos-12.0/pos-12.0-pos_price_to_weight
Translate-URL: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_price_to_weight/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: pos-12.0/pos-12.0-pos_price_to_weight
Translate-URL: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_price_to_weight/
Currently translated at 21.1% (4 of 19 strings)

Translation: pos-12.0/pos-12.0-pos_price_to_weight
Translate-URL: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_price_to_weight/fr/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: pos-12.0/pos-12.0-pos_price_to_weight
Translate-URL: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_price_to_weight/
Currently translated at 100.0% (20 of 20 strings)

Translation: pos-12.0/pos-12.0-pos_price_to_weight
Translate-URL: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_price_to_weight/es/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: pos-12.0/pos-12.0-pos_price_to_weight
Translate-URL: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_price_to_weight/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: pos-12.0/pos-12.0-pos_price_to_weight
Translate-URL: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_price_to_weight/
Currently translated at 100.0% (21 of 21 strings)

Translation: pos-12.0/pos-12.0-pos_price_to_weight
Translate-URL: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_price_to_weight/ca/
Currently translated at 100.0% (21 of 21 strings)

Translation: pos-12.0/pos-12.0-pos_price_to_weight
Translate-URL: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_price_to_weight/it/
Currently translated at 100.0% (21 of 21 strings)

Translation: pos-12.0/pos-12.0-pos_price_to_weight
Translate-URL: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_price_to_weight/it/
@legalsylvain
Copy link
Contributor Author

/ocabot migration pos_price_to_weight

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Jan 27, 2024
@OCA-git-bot OCA-git-bot mentioned this pull request Jan 27, 2024
30 tasks
[REM] Remove useless 'Price To Weight Field' on the pos.config. (sale price is lst_price).
[REF] Adapt js code to new PoS framework.
[REF] Move barcode.rule 'data' into 'demo'
Copy link

@quentinDupont quentinDupont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

functional review, works fine ✔️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants