Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
290 changes: 290 additions & 0 deletions pos_tare/i18n/fr_CH.po
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."

6 changes: 6 additions & 0 deletions pos_tare/models/pos_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
class PosConfig(models.Model):
_inherit = "pos.config"

iface_tare_on_scale_screen_method = fields.Boolean(
string='Show tare input on scale screen',
help="Adds an input text field to set the tare on the scale screen.",
default=True
)

iface_tare_method = fields.Selection(
[
("manual", "Input the tare manually"),
Expand Down
18 changes: 17 additions & 1 deletion pos_tare/static/src/js/screens.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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";
Copy link
Contributor

Choose a reason for hiding this comment

The 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...)

Copy link
Author

@Fkawala Fkawala Nov 20, 2020

Choose a reason for hiding this comment

The 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.

Copy link
Author

Choose a reason for hiding this comment

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

@legalsylvain What's your opinion on that? Are we all good?

Copy link
Contributor

Choose a reason for hiding this comment

The 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 :

  • select the product with kilogram unit (Cable Management Box) (stock.product_cable_management_box)
  • change the quantity (70kg in hand).
  • select the uom kg (uom.product_uom_kgm)
  • try to change uom.

You'll have this errors.

image

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.
It will make the code simpler.
Dont you think ?

})[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};
Expand Down
16 changes: 9 additions & 7 deletions pos_tare/static/src/xml/pos_tare.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
<t t-esc="widget.pos.config.iface_tare_uom_id[1]"/>
</div>
</t>
<div class="weight-label">
Tare
</div>
<div class="weight-value weight-value-alterable">
<input type="text" class="input-weight" id="input_weight_tare" placeholder="0.000"/>
<t t-esc="widget.pos.config.iface_tare_uom_id[1]"/>
</div>
<t t-if="widget.pos.config.iface_tare_on_scale_screen_method">
<div class="weight-label">
Tare
</div>
<div class="weight-value weight-value-alterable">
<input type="text" class="input-weight" id="input_weight_tare" placeholder="0.000"/>
<t t-esc="widget.pos.config.iface_tare_uom_id[1]"/>
</div>
</t>
</t>
</t>
</t>
Expand Down
11 changes: 11 additions & 0 deletions pos_tare/views/view_pos_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@
</div>
</div>
</div>
<div class="col-xs-12 col-lg-6 o_setting_box" id="iface_tare_method">
<div class="o_setting_left_pane">
<field name="iface_tare_on_scale_screen_method" class="o_light_label"/>
</div>
<div class="o_setting_right_pane">
<label for="iface_tare_on_scale_screen_method" string="Tare on scale screen"/>
<div class="text-muted">
User can input tare directly in scale screen.
</div>
</div>
</div>
<div class="col-xs-12 col-lg-6 o_setting_box" id="iface_tare_method">
<div class="o_setting_right_pane">
<label for="iface_tare_uom_id" string="Tare UoM"/>
Expand Down
Loading