Skip to content
Snippets Groups Projects
Commit b67a8929 authored by Jacky (trj)'s avatar Jacky (trj)
Browse files

[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#117942

Signed-off-by: default avatarJoseph Caburnay (jcb) <jcb@odoo.com>
parent 904897d3
No related branches found
No related tags found
No related merge requests found
......@@ -70,14 +70,15 @@ models.Order = models.Order.extend({
var orderline_super = models.Orderline.prototype;
models.Orderline = models.Orderline.extend({
can_be_merged_with: function(orderline) {
let order = this.pos.get_order();
let lastId = order.orderlines.last().cid;
if(this.pos.is_french_country() && (order.orderlines._byId[lastId].product.id !== orderline.product.id || order.orderlines._byId[lastId].quantity < 0)) {
return false;
} else {
if (this.pos.is_french_country()) {
const order = this.pos.get_order();
const lastId = order.orderlines.last().cid;
if ((order.orderlines._byId[lastId].product.id !== orderline.product.id || order.orderlines._byId[lastId].quantity < 0)) {
return false;
}
return orderline_super.can_be_merged_with.apply(this, arguments);
}
return orderline_super.can_be_merged_with.apply(this, arguments);
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment