-
-
Notifications
You must be signed in to change notification settings - Fork 680
[12.0][MIG] pos_tare_generate_barcode #527
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
Changes from all commits
1db7df0
ba18a7f
1c37321
2766f64
59b6e7d
2e40ce8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,290 @@ | ||
| # Translation of Odoo Server. | ||
| # This file contains the translation of the following modules: | ||
| # * pos_tare | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Odoo Server 12.0\n" | ||
| "Report-Msgid-Bugs-To: \n" | ||
| "POT-Creation-Date: 2020-08-27 12:55+0000\n" | ||
| "PO-Revision-Date: 2020-08-27 12:55+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_tare | ||
| #. openerp-web | ||
| #: code:addons/pos_tare/static/src/xml/pos_tare.xml:34 | ||
| #, python-format | ||
| msgid "(Gross Weight:" | ||
| msgstr "(Poids brut:" | ||
|
|
||
| #. module: pos_tare | ||
| #. openerp-web | ||
| #: code:addons/pos_tare/static/src/xml/pos_tare.xml:36 | ||
| #, python-format | ||
| msgid "- Tare:" | ||
| msgstr "- Tare :" | ||
|
|
||
| #. module: pos_tare | ||
| #: selection:barcode.rule,type:0 | ||
| msgid "Alias" | ||
| msgstr "" | ||
|
|
||
| #. module: pos_tare | ||
| #. openerp-web | ||
| #: code:addons/pos_tare/static/src/xml/pos_tare.xml:103 | ||
| #, python-format | ||
| msgid "Backspace" | ||
| msgstr "" | ||
|
|
||
| #. module: pos_tare | ||
| #: model:ir.model,name:pos_tare.model_barcode_rule | ||
| msgid "Barcode Rule" | ||
| msgstr "Règle de code barre" | ||
|
|
||
| #. module: pos_tare | ||
| #: selection:barcode.rule,type:0 | ||
| msgid "Cashier" | ||
| msgstr "Caissier" | ||
|
|
||
| #. module: pos_tare | ||
| #: selection:barcode.rule,type:0 | ||
| msgid "Client" | ||
| msgstr "" | ||
|
|
||
| #. module: pos_tare | ||
| #: model_terms:ir.ui.view,arch_db:pos_tare.view_pos_config_form | ||
| msgid "Configure how to input Gross Weight." | ||
| msgstr "Méthode de saisie du poids brut." | ||
|
|
||
| #. module: pos_tare | ||
| #: model_terms:ir.ui.view,arch_db:pos_tare.view_pos_config_form | ||
| msgid "Configure how to tare products to weight with a scale." | ||
| msgstr "Méthode de saisie de la tare pour les produit à peser avec une balance." | ||
|
|
||
| #. module: pos_tare | ||
| #. openerp-web | ||
| #: code:addons/pos_tare/static/src/xml/pos_tare.xml:94 | ||
| #, python-format | ||
| msgid "Disc" | ||
| msgstr "" | ||
|
|
||
| #. module: pos_tare | ||
| #: selection:barcode.rule,type:0 | ||
| msgid "Discounted Product" | ||
| msgstr "Article en promotion" | ||
|
|
||
| #. module: pos_tare | ||
| #. openerp-web | ||
| #: code:addons/pos_tare/static/src/xml/pos_tare.xml:7 | ||
| #, python-format | ||
| msgid "Gross Weight" | ||
| msgstr "Poids brut" | ||
|
|
||
| #. module: pos_tare | ||
| #. openerp-web | ||
| #: code:addons/pos_tare/static/src/xml/pos_tare.xml:48 | ||
| #, python-format | ||
| msgid "Gross Weight :" | ||
| msgstr "Poids brut :" | ||
|
|
||
| #. module: pos_tare | ||
| #: model:ir.model.fields,field_description:pos_tare.field_pos_config__iface_gross_weight_method | ||
| #: model_terms:ir.ui.view,arch_db:pos_tare.view_pos_config_form | ||
| msgid "Gross Weight Input Method" | ||
| msgstr "Méthode de saisie du poids buit." | ||
|
|
||
| #. module: pos_tare | ||
| #. openerp-web | ||
| #: code:addons/pos_tare/static/src/js/screens.js:79 | ||
| #: code:addons/pos_tare/static/src/js/screens.js:183 | ||
| #, python-format | ||
| msgid "Incorrect Tare Value" | ||
| msgstr "La valeur de la tare est incorrecte" | ||
|
|
||
| #. module: pos_tare | ||
| #: selection:pos.config,iface_gross_weight_method:0 | ||
| msgid "Input Gross Weight via Scale" | ||
| msgstr "Mesurer le poids brut en utilisant une balance électronique" | ||
|
|
||
| #. module: pos_tare | ||
| #: selection:pos.config,iface_gross_weight_method:0 | ||
| msgid "Input the Gross Weight manually" | ||
| msgstr "Saisir le poids brut manuellement" | ||
|
|
||
| #. module: pos_tare | ||
| #: selection:pos.config,iface_tare_method:0 | ||
| msgid "Input the tare manually" | ||
| msgstr "Saisir la tare manuellement" | ||
|
|
||
| #. module: pos_tare | ||
| #: selection:barcode.rule,type:0 | ||
| msgid "Location" | ||
| msgstr "Lieu" | ||
|
|
||
| #. module: pos_tare | ||
| #: selection:barcode.rule,type:0 | ||
| msgid "Lot" | ||
| msgstr "" | ||
|
|
||
| #. module: pos_tare | ||
| #: selection:pos.config,iface_tare_method:0 | ||
| msgid "Manual input and barcode" | ||
| msgstr "Saisir la tare manuellement et avec les codes barres" | ||
|
|
||
| #. module: pos_tare | ||
| #: selection:barcode.rule,type:0 | ||
| msgid "Package" | ||
| msgstr "Colis" | ||
|
|
||
| #. module: pos_tare | ||
| #. openerp-web | ||
| #: code:addons/pos_tare/static/src/js/screens.js:80 | ||
| #, python-format | ||
| msgid "Please set a numeric value in the tare field, or let empty." | ||
| msgstr "Saisissez une valeure numérique dans le champ dédié à la tare ou laisser ce champ vide. " | ||
|
|
||
| #. module: pos_tare | ||
| #: model:ir.model,name:pos_tare.model_pos_config | ||
| msgid "Point of Sale Configuration" | ||
| msgstr "Paramétrage du point de vente" | ||
|
|
||
| #. module: pos_tare | ||
| #: model:ir.model,name:pos_tare.model_pos_order_line | ||
| msgid "Point of Sale Order Lines" | ||
| msgstr "Lignes des commandes du point de vente" | ||
|
|
||
| #. module: pos_tare | ||
| #. openerp-web | ||
| #: code:addons/pos_tare/static/src/xml/pos_tare.xml:100 | ||
| #, python-format | ||
| msgid "Price" | ||
| msgstr "" | ||
|
|
||
| #. module: pos_tare | ||
| #: selection:barcode.rule,type:0 | ||
| msgid "Priced Product" | ||
| msgstr "Article à prix fixe" | ||
|
|
||
| #. module: pos_tare | ||
| #. openerp-web | ||
| #: code:addons/pos_tare/static/src/xml/pos_tare.xml:82 | ||
| #, python-format | ||
| msgid "Qty" | ||
| msgstr "" | ||
|
|
||
| #. module: pos_tare | ||
| #. openerp-web | ||
| #: code:addons/pos_tare/static/src/js/screens.js:146 | ||
| #, python-format | ||
| msgid "Quantity lower or equal to zero" | ||
| msgstr "La quantité est inférieure ou égale à zéro" | ||
|
|
||
| #. module: pos_tare | ||
| #: selection:pos.config,iface_tare_method:0 | ||
| msgid "Scan a barcode to set the tare" | ||
| msgstr "Saisir la tare en utilisant les codes barres" | ||
|
|
||
| #. module: pos_tare | ||
| #: 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" | ||
| "* 'both' : manual input and barcode methods are enabled;" | ||
| msgstr "Sélectionnez la méthode de saisie de la tare:\n" | ||
| "* 'manual' : l'écran de pesé dispose d'un nouveau champ pour saisir la tare;\n" | ||
| "* 'barecode' : utilisez des codes barres pour encoder la valeur de la tare. A la lecture du code barre la tare est appliquée à l'article selectionné;\n" | ||
| "* 'both' : les deux méthodes (manuelle et par code barre) sont activées;" | ||
|
|
||
| #. module: pos_tare | ||
| #. openerp-web | ||
| #: code:addons/pos_tare/static/src/xml/pos_tare.xml:19 | ||
| #: code:addons/pos_tare/static/src/xml/pos_tare.xml:88 | ||
| #: selection:barcode.rule,type:0 | ||
| #: model:ir.model.fields,field_description:pos_tare.field_pos_order_line__tare | ||
| #, python-format | ||
| msgid "Tare" | ||
| msgstr "" | ||
|
|
||
| #. module: pos_tare | ||
| #. openerp-web | ||
| #: code:addons/pos_tare/static/src/xml/pos_tare.xml:50 | ||
| #, python-format | ||
| msgid "Tare :" | ||
| msgstr "" | ||
|
|
||
| #. module: pos_tare | ||
| #: model:ir.model.fields,field_description:pos_tare.field_pos_config__iface_tare_method | ||
| #: model_terms:ir.ui.view,arch_db:pos_tare.view_pos_config_form | ||
| msgid "Tare Input Method" | ||
| msgstr "Méthode de saisie de la tare" | ||
|
|
||
| #. module: pos_tare | ||
| #: model_terms:ir.ui.view,arch_db:pos_tare.view_pos_config_form | ||
| msgid "Tare UoM" | ||
| msgstr "" | ||
|
|
||
| #. module: pos_tare | ||
| #. openerp-web | ||
| #: code:addons/pos_tare/static/src/js/screens.js:148 | ||
| #, python-format | ||
| msgid "The quantity for \"%s\" is lower or equal to zero. Call for help unless you're perfectly sure you are doing right." | ||
| msgstr "La quantité pour le produit \"%s\" est inférieur ou égale à zéro. Appelez à l'aide pour résoudre ce problème. Ne continuez que si vous êtes absolument sûr·e et certain·e que vous faites le bon choix." | ||
|
|
||
| #. module: pos_tare | ||
| #: model:ir.model.fields,field_description:pos_tare.field_barcode_rule__type | ||
| msgid "Type" | ||
| msgstr "" | ||
|
|
||
| #. module: pos_tare | ||
| #: selection:barcode.rule,type:0 | ||
| msgid "Unit Product" | ||
| msgstr "Unité de produit" | ||
|
|
||
| #. module: pos_tare | ||
| #: model:ir.model.fields,field_description:pos_tare.field_pos_config__iface_tare_uom_id | ||
| msgid "Unit of Measure of the tare" | ||
| msgstr "Unité de mesure de la tare" | ||
|
|
||
| #. module: pos_tare | ||
| #: model_terms:ir.ui.view,arch_db:pos_tare.view_pos_config_form | ||
| msgid "Unit of Measure of the tares." | ||
| msgstr "Unité de mesure des tares." | ||
|
|
||
| #. module: pos_tare | ||
| #. openerp-web | ||
| #: code:addons/pos_tare/static/src/js/screens.js:23 | ||
| #, python-format | ||
| msgid "We can not apply this tare barcode." | ||
| msgstr "Impossible d'appliquer ce code barre de tare." | ||
|
|
||
| #. module: pos_tare | ||
| #. openerp-web | ||
| #: code:addons/pos_tare/static/src/js/screens.js:192 | ||
| #, python-format | ||
| msgid "We can not apply this tare." | ||
| msgstr "Impossible d'appliquer cette tare." | ||
|
|
||
| #. module: pos_tare | ||
| #. openerp-web | ||
| #: code:addons/pos_tare/static/src/js/tools.js:17 | ||
| #, python-format | ||
| msgid "We can not cast a weight in %s into %s." | ||
| msgstr "Il n'est pas possible de convertir un poids mesuré en %s vers un poids en %s " | ||
|
|
||
| #. module: pos_tare | ||
| #: selection:barcode.rule,type:0 | ||
| msgid "Weighted Product" | ||
| msgstr "Article pesé" | ||
|
|
||
| #. module: pos_tare | ||
| #. openerp-web | ||
| #: code:addons/pos_tare/static/src/js/screens.js:184 | ||
| #, python-format | ||
| msgid "You can not set the tare. To be able to set the tare manually you have to change the tare input method in the POS configuration." | ||
| msgstr "Vous ne pouvez pas définir la tare. Pour pouvoir définir la tare manuellement vous devez changer la méthode de saisie de la tare dans la configuration du POS." | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,10 +4,12 @@ odoo.define('pos_tare.screens', function (require) { | |
| var core = require('web.core'); | ||
| var screens = require('point_of_sale.screens'); | ||
| var utils = require('web.utils'); | ||
| var tools = require('pos_tare.tools'); | ||
|
|
||
| var _t = core._t; | ||
| var round_pr = utils.round_precision; | ||
| var leq_zero_qty = (ol) => ol.get_quantity() <= 0; | ||
| var convert_mass = tools.convert_mass; | ||
|
|
||
| // This configures read action for tare barcode. A tare barcode contains a | ||
| // fake product ID and the weight to be subtracted from the product in the | ||
|
|
@@ -18,7 +20,21 @@ odoo.define('pos_tare.screens', function (require) { | |
| var order = this.pos.get_order(); | ||
| var selected_order_line = order.get_selected_orderline(); | ||
| var tare_weight = code.value; | ||
| selected_order_line.set_tare(tare_weight, true); | ||
| var tare_uom = this.pos.config.iface_tare_uom_id[0]; | ||
| var tare_unit = this.pos.units_by_id[tare_uom]; | ||
| var kilogram_uom = this.pos.units.filter( | ||
| function (u) { | ||
| return u.name === "kg"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry. I still don't understand why there are hardcoded text regarding uom in this module. there is no way to have something more modular ? if it's not possible, do you think you could write a section in the ROADMAP section, to mention to do it (maybe when odoo PoS will be refactored...)
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assume you do not hard code this UOM (the one that is used to encode the tare barcode labels). Let's say this UOM is configured to be kilogram. Now print a tare label with 1 unit of UOM, that's one kilogram. Assume the user changes the configuration for this UOM and selects "metric ton". Afterwards one scans the old tare barcode label, she'll get a tare of one metric ton instead of the correct weight of the container that is one kilogram. If you have a better solution than hard coding, I'm happy to change that. Hope this is clear enough.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @legalsylvain What's your opinion on that? Are we all good?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry. Back on that point. I was fully busy the last monthes. I think " Assume the user changes the configuration for this UOM and selects "metric ton" can not occure. I tested your Use case with demo data in V12 :
You'll have this errors. My opinion is that odoo doesn't handle that use case. (that is quite hard to handle, I think). so, you should not have to handle that use case in a OCA module, if Odoo core module doesn't allow it. |
||
| })[0]; | ||
| if (typeof kilogram_uom === 'undefined') { | ||
| throw new Error( | ||
| _t("You need to setup a kilogram (kg) UOM "+ | ||
| "this UOM is used to encode the tare mass "+ | ||
| "in the tare barcode.")); | ||
| } | ||
| var tare_weight_in_tare_uom = convert_mass(tare_weight, | ||
| kilogram_uom, tare_unit); | ||
| selected_order_line.set_tare(tare_weight_in_tare_uom, true); | ||
| } catch (error) { | ||
| var title = _t("We can not apply this tare barcode."); | ||
| var popup = {title: title, body: error.message}; | ||
|
|
||

Uh oh!
There was an error while loading. Please reload this page.