From ea881196d26c7e03ccb72d21ed72c0cecb20d06c Mon Sep 17 00:00:00 2001 From: "Jacky (trj)" Date: Thu, 6 Apr 2023 13:27:06 +0000 Subject: [PATCH] [FIX] l10n_fr_pos_cert: scope can_be_merged_with The content of the override of `can_be_merged_with` should only be executed when we're in France. The previous implementation resulted in breaking the `test_05_tip_screen` when this module was installed with pos_restaurant. closes odoo/odoo#118573 X-original-commit: 0d0a5e9ddc838f34bfbc469f9a8fceaeeadaa24d Signed-off-by: Joseph Caburnay (jcb) --- addons/l10n_fr_pos_cert/static/src/js/pos.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/l10n_fr_pos_cert/static/src/js/pos.js b/addons/l10n_fr_pos_cert/static/src/js/pos.js index 9847d3c954c..1edc8148419 100644 --- a/addons/l10n_fr_pos_cert/static/src/js/pos.js +++ b/addons/l10n_fr_pos_cert/static/src/js/pos.js @@ -68,14 +68,14 @@ patch(Order.prototype, "l10n_fr_pos_cert.Order", { patch(Orderline.prototype, "l10n_fr_pos_cert.Orderline", { can_be_merged_with(orderline) { + if (!this.pos.is_french_country()) { + return this._super(...arguments); + } const order = this.pos.get_order(); const orderlines = order.orderlines; const lastOrderline = order.orderlines.at(orderlines.length - 1); - if ( - this.pos.is_french_country() && - (lastOrderline.product.id !== orderline.product.id || lastOrderline.quantity < 0) - ) { + if (lastOrderline.product.id !== orderline.product.id || lastOrderline.quantity < 0) { return false; } else { return this._super(...arguments);