Skip to content

Conversation

@huguesdk
Copy link
Member

@huguesdk huguesdk commented Feb 28, 2025

this is a follow-up on #1224. it contains all of its commits (as it’s the same branch), as well as several commits to restore features present in version 12.0 but that disappeared during the migration to 14.0, with also some fixes and improvements.

legalsylvain and others added 30 commits June 20, 2024 15:13
[ADD] barcode nomenclature for tare
[ADD] tare field on pos.order.line model
[ADD] Tare button in PoS numpad
[IMP] handle correctly different UoM
[IMP] add warning at checkout if qty <=0
[IMP] display gross and tare weight for each line

Co-authored-by: François Kawala <[email protected]>
Co-authored-by: Sylvain LE GAL <[email protected]>
Currently translated at 100.0% (46 of 46 strings)

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

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

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

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

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

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

Translation: pos-12.0/pos-12.0-pos_tare
Translate-URL: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_tare/it/
@huguesdk huguesdk marked this pull request as draft March 19, 2025 09:03
don't focus fields on the scale screen when the tare can be input with a
barcode reader to avoid filling the field with the barcode value.
@huguesdk huguesdk marked this pull request as ready for review April 1, 2025 09:14
@victor-champonnois
Copy link
Member

@huguesdk I've updated the doc but the image links do not work, I don't manage to figure out why.

@huguesdk
Copy link
Member Author

@victor-champonnois thanks! it's normal: images link to their location on github in the main branch for the version (16.0 in this case). they will appear only when the branch will be merged.

@github-actions
Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Sep 14, 2025
@huguesdk
Copy link
Member Author

@OCA/pos-maintainers could anyone please review or merge this?

@github-actions github-actions bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Sep 21, 2025
@polchampion
Copy link

@OCA/pos-maintainers could anyone please review or merge this?

@Fkawala
Copy link

Fkawala commented Oct 24, 2025

LGTM, but I'd like someone more active in the project @OCA/pos-maintainers to have a second look on this before merging. Thank you so much for your work on this @huguesdk !

Copy link

@ivantodorovich ivantodorovich left a comment

Choose a reason for hiding this comment

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

I don't have experience with this module, but technically it looks good.
I would perhaps encourage you to squash some of the commits into the migration one, as they seem to be a part of it

Copy link

@ferdymercury ferdymercury left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this migration.

Looks good to me for merging. Just indicating some irrelevant typos and clarifications that could be fixed.

.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_tare/static/description/pos_config.png


To generate a tare barcode you need to use the default barcode nomenclature. The default barcode pattern is `0700000{NNDDD}`. Using that pattern, the barcode for a tare of 0.1kg is `0700000001006`. The `pos_tare_barcode_generator` allows you to create tare labels right from the POS.
Copy link

@ferdymercury ferdymercury Dec 7, 2025

Choose a reason for hiding this comment

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

Suggested change
To generate a tare barcode you need to use the default barcode nomenclature. The default barcode pattern is `0700000{NNDDD}`. Using that pattern, the barcode for a tare of 0.1kg is `0700000001006`. The `pos_tare_barcode_generator` allows you to create tare labels right from the POS.
To generate a tare barcode you need to use the [default barcode nomenclature](https://www.odoo.com/documentation/16.0/applications/inventory_and_mrp/barcode/operations/barcode_nomenclature.html). The default EAN-13 barcode pattern is `0700000{NNDDD}C`, where `NN` are the kilograms, `DDD` are the grams and `C` is a check digit. Using that pattern, the barcode for a tare of 0.123kg is `0700000001236`. The maximum weight that can be represented with this barcode is just below 100 kg. The embedded barcode generator allows you to create and print tare labels right from the POS.

Is pos_tare_barcode_generator a separate module or subfunction ? If not, maybe reword as suggested.

Copy link
Member Author

Choose a reason for hiding this comment

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

i’m not aware of this module. i quickly looked in earlier versions but did not find it. another module (pos_self_service_weighing_tare, see #1397) allows to do this (but not from another pos than the one used to sell products).


.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_tare/static/description/pos_config.png


Choose a reason for hiding this comment

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

One curiosity, why did you choose 07 as prefix?

Copy link
Member Author

Choose a reason for hiding this comment

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

i don’t know where this prefix comes from. @legalsylvain do you know this?


To generate a tare barcode you need to use the default barcode nomenclature. The default barcode pattern is `0700000{NNDDD}`. Using that pattern, the barcode for a tare of 0.1kg is `0700000001006`. The `pos_tare_barcode_generator` allows you to create tare labels right from the POS.

you can define a default tare on the product form view, if you always use the same type of packaging (or container) for a given product.

Choose a reason for hiding this comment

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

Suggested change
you can define a default tare on the product form view, if you always use the same type of packaging (or container) for a given product.
You can define a default tare on the product form view, if you always use the same type of packaging (or container) for a given product.

.. figure:: ../static/description/pos_config.png


To generate a tare barcode you need to use the default barcode nomenclature. The default barcode pattern is `0700000{NNDDD}`. Using that pattern, the barcode for a tare of 0.1kg is `0700000001006`. The `pos_tare_barcode_generator` allows you to create tare labels right from the POS.

Choose a reason for hiding this comment

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

Same comments/corrections as above would apply, since this paragraph is duplicated.

Maybe this whole file can be replaced with just a link pointing to the proper section in README.rst ?

Give the possibility to the user to enter a Tare weight, when weighing
products in the Point of Sale.
This will compute automatically net weight and set it to the current
selected order

Choose a reason for hiding this comment

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

Suggested change
selected order
selected order.

@@ -0,0 +1,3 @@
- Sylvain LE GAL (https://www.twitter.com/legalsylvain)

Choose a reason for hiding this comment

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

in the README.rst, also GRAP is listed

Copy link
Member Author

Choose a reason for hiding this comment

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

sylvain le gal works for grap.

Give the possibility to the user to enter a Tare weight, when weighing
products in the Point of Sale.
This will compute automatically net weight and set it to the current
selected order

Choose a reason for hiding this comment

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

Suggested change
selected order
selected order.

Or remove with a link to README to avoid duplication?

Comment on lines 413 to 414
<p>To generate a tare barcode you need to use the default barcode nomenclature. The default barcode pattern is <cite>0700000{NNDDD}</cite>. Using that pattern, the barcode for a tare of 0.1kg is <cite>0700000001006</cite>. The <cite>pos_tare_barcode_generator</cite> allows you to create tare labels right from the POS.</p>
<p>you can define a default tare on the product form view, if you always use the same type of packaging (or container) for a given product.</p>
Copy link

@ferdymercury ferdymercury Dec 7, 2025

Choose a reason for hiding this comment

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

Same corrections / comments as above.

<p>Give the possibility to the user to enter a Tare weight, when weighing
products in the Point of Sale.
This will compute automatically net weight and set it to the current
selected order</p>

Choose a reason for hiding this comment

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

Suggested change
selected order</p>
selected order.</p>

@huguesdk
Copy link
Member Author

@ivantodorovich thanks for the review. i’m not sure about squashing the commits, as many features of version 12.0 had been lost in the porting to 14.0, and they had to be re-added after the porting to 16.0. that’s why i think it is useful to keep them separate, especially as they explain better each change. what do you think?

Copy link
Member Author

@huguesdk huguesdk left a comment

Choose a reason for hiding this comment

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

@ferdymercury thanks for the review. i’ve update the readme with your suggestions (and improved it a little bit also). please note that the readme fragments (from the readme directory) are restructuredtext, not markdown, and that README.rst and static/description/index.html are automatically generated from them.


.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_tare/static/description/pos_config.png


Copy link
Member Author

Choose a reason for hiding this comment

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

i don’t know where this prefix comes from. @legalsylvain do you know this?

@@ -0,0 +1,3 @@
- Sylvain LE GAL (https://www.twitter.com/legalsylvain)
Copy link
Member Author

Choose a reason for hiding this comment

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

sylvain le gal works for grap.

.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_tare/static/description/pos_config.png


To generate a tare barcode you need to use the default barcode nomenclature. The default barcode pattern is `0700000{NNDDD}`. Using that pattern, the barcode for a tare of 0.1kg is `0700000001006`. The `pos_tare_barcode_generator` allows you to create tare labels right from the POS.
Copy link
Member Author

Choose a reason for hiding this comment

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

i’m not aware of this module. i quickly looked in earlier versions but did not find it. another module (pos_self_service_weighing_tare, see #1397) allows to do this (but not from another pos than the one used to sell products).

Copy link

@ferdymercury ferdymercury left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the fixes!

I agree it's better to keep the current commit history (no need to squash)

Copy link

@ferdymercury ferdymercury left a comment

Choose a reason for hiding this comment

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

some minor typos in the translation

#. module: pos_tare
#: selection:barcode.rule,type:0
msgid "Meal Voucher Payment"
msgstr ""

Choose a reason for hiding this comment

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

Suggested change
msgstr ""
msgstr "Pago de cupón de comida"

#: code:addons/pos_tare/static/src/js/screens.js:185
#, python-format
msgid "Feature Disabled"
msgstr ""

Choose a reason for hiding this comment

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

Suggested change
msgstr ""
msgstr "Característica deshabilitada"

#: model:product.product,name:pos_tare.cheese
#: model:product.template,name:pos_tare.cheese_product_template
msgid "Cheese by the Slice"
msgstr ""

Choose a reason for hiding this comment

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

Suggested change
msgstr ""
msgstr "Queso al corte"

#: code:addons/pos_tare/static/src/xml/pos_tare.xml:34
#, python-format
msgid "Gross Weight:"
msgstr ""

Choose a reason for hiding this comment

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

Suggested change
msgstr ""
msgstr "Peso bruto:"

#: code:addons/pos_tare/static/src/js/screens.js:91
#, python-format
msgid "Incorrect Gross Weight Value"
msgstr ""

Choose a reason for hiding this comment

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

Suggested change
msgstr ""
msgstr "Valor de peso bruto incorrecto"

#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"

Choose a reason for hiding this comment

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

Suggested change
"Project-Id-Version: Odoo Server 12.0\n"
"Project-Id-Version: Odoo Server 16.0\n"

#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"

Choose a reason for hiding this comment

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

Suggested change
"Project-Id-Version: Odoo Server 12.0\n"
"Project-Id-Version: Odoo Server 16.0\n"

#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"

Choose a reason for hiding this comment

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

Suggested change
"Project-Id-Version: Odoo Server 12.0\n"
"Project-Id-Version: Odoo Server 16.0\n"

#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"

Choose a reason for hiding this comment

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

Suggested change
"Project-Id-Version: Odoo Server 12.0\n"
"Project-Id-Version: Odoo Server 16.0\n"

#: model:ir.model.fields,help:pos_tare.field_pos_config__iface_tare_method
msgid "Select tare method:\n"
"* 'manual' : the scale screen has an extra tare input field;\n"
"* 'barecode' : (scan a barcode to tare the selected order line;\n"

Choose a reason for hiding this comment

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

Suggested change
"* 'barecode' : (scan a barcode to tare the selected order line;\n"
"* 'barcode' : scan a barcode to tare the selected order line;\n"

@huguesdk
Copy link
Member Author

@ferdymercury the translation files will be updated automatically by the bot after merge. once merged, you will be able to add new translations using weblate (link to version 12 of the translation of this module, as 16 will be created after merge).

* display an error message when a tare is set on a product that uses a
  different uom category than the one used for the tare instead of just
  throwing an exception and making the pos unusable until it is
  reloaded.
* don't compute the weight if no tare is set to avoid uom categories
  mismatch errors, falling back to odoo's default behavior.
@huguesdk
Copy link
Member Author

huguesdk commented Jan 7, 2026

i’ve added a new commit to gracefully handle uom categories mismatch errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.