[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) <jcb@odoo.com>
This commit is contained in:
Jacky (trj)
2023-04-14 11:49:33 +02:00
committed by pedrambiria
parent 51761f1918
commit ea881196d2
+4 -4
View File
@@ -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);