Commit 56ebb334 by Etienne Freiss

Modif. Pensez à mettre à jour le module

parent 7cd0bdea
...@@ -292,3 +292,23 @@ msgstr "En cliquant sur ce bouton, tous les produits de cette catégories auront ...@@ -292,3 +292,23 @@ msgstr "En cliquant sur ce bouton, tous les produits de cette catégories auront
msgid "kg" msgid "kg"
msgstr "kg" msgstr "kg"
#. module: pos_meal_voucher
#. openerp-web
#: code:addons/pos_meal_voucher/static/src/js/screens.js:159
#, python-format
msgid "Meal Voucher Amount incorrect"
msgstr "Titre restaurant incorrect"
#. module: pos_meal_voucher
#. openerp-web
#: code:addons/pos_meal_voucher/static/src/js/screens.js:160
#, python-format
msgid "Warning, the maximum amount of meal voucher accepted ( "
msgstr "Attention, le montant éligible au paiement par titre restaurant( "
#. module: pos_meal_voucher
#. openerp-web
#: code:addons/pos_meal_voucher/static/src/js/screens.js:160
#, python-format
msgid " ) is under the amount input ( "
msgstr " ) est inférieur à la valeur du/des ticket(s)( "
...@@ -16,3 +16,7 @@ class PosConfig(models.Model): ...@@ -16,3 +16,7 @@ class PosConfig(models.Model):
meal_voucher_display_product_screen = fields.Boolean( meal_voucher_display_product_screen = fields.Boolean(
string="Display icon before products on screen", string="Display icon before products on screen",
default=True) default=True)
meal_voucher_change_accepted = fields.Boolean(
string="Give change on meal voucher",
default=True)
...@@ -136,8 +136,8 @@ odoo.define("pos_meal_voucher.screens", function (require) { ...@@ -136,8 +136,8 @@ odoo.define("pos_meal_voucher.screens", function (require) {
current_max = Math.min(total_eligible, max_amount); current_max = Math.min(total_eligible, max_amount);
} }
// if the change is too large, it's probably an input error, make the user confirm. // if the change is too large, it's probably an input error, if giving change is accepted make the user confirm.
if (!force_validation && (total_received > current_max)) { if (!force_validation && (total_received > current_max) && this.pos.config.meal_voucher_change_accepted) {
this.gui.show_popup("confirm", { this.gui.show_popup("confirm", {
'title': _t("Please Confirm Meal Voucher Amount"), 'title': _t("Please Confirm Meal Voucher Amount"),
'body': _t("You are about to validate a meal voucher payment of ") + 'body': _t("You are about to validate a meal voucher payment of ") +
...@@ -153,6 +153,18 @@ odoo.define("pos_meal_voucher.screens", function (require) { ...@@ -153,6 +153,18 @@ odoo.define("pos_meal_voucher.screens", function (require) {
}); });
return false; return false;
} }
//else force user to correct
else if (!force_validation && (total_received > current_max) && !this.pos.config.meal_voucher_change_accepted) {
this.gui.show_popup("alert", {
'title': _t("Meal Voucher Amount incorrect"),
'body': _t("Warning, the maximum amount of meal voucher accepted ( ") +
this.format_currency(current_max) +
_t(" ) is under the amount input ( ") +
this.format_currency(total_received) +
_t(")"),
});
return false;
}
return this._super.apply(this, arguments); return this._super.apply(this, arguments);
}, },
}); });
......
...@@ -14,6 +14,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). ...@@ -14,6 +14,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
<group string="Meal Vouchers"> <group string="Meal Vouchers">
<field name="max_meal_voucher_amount"/> <field name="max_meal_voucher_amount"/>
<field name="meal_voucher_display_product_screen"/> <field name="meal_voucher_display_product_screen"/>
<field name="meal_voucher_change_accepted"/>
</group> </group>
</field> </field>
</field> </field>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment