From 9e8c451f694401f9dfb954e3a6443c64a52070a0 Mon Sep 17 00:00:00 2001 From: "Pedram (pebr)" Date: Wed, 17 Apr 2024 17:12:10 +0200 Subject: [PATCH] [FIX] point_of_sale: prevent duplicate display of multi attributes Prior to this commit, if a product had multiple attributes, each attribute would be displayed multiple times in the order line. This commit resolves this issue by ensuring that each attribute line is displayed only once. opw-3849701 closes odoo/odoo#162258 Signed-off-by: Vlad Stroia (vlst) --- addons/point_of_sale/static/src/app/store/models.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/point_of_sale/static/src/app/store/models.js b/addons/point_of_sale/static/src/app/store/models.js index 9a98f16c653..bb0dcf5c091 100644 --- a/addons/point_of_sale/static/src/app/store/models.js +++ b/addons/point_of_sale/static/src/app/store/models.js @@ -1095,8 +1095,12 @@ export class Orderline extends PosModel { } findAttribute(values, customAttributes) { const listOfAttributes = []; + const addedPtal_id = []; for (const value of values){ for (const ptal_id of this.pos.ptal_ids_by_ptav_id[value]){ + if (addedPtal_id.includes(ptal_id)){ + continue; + } const attribute = this.pos.attributes_by_ptal_id[ptal_id] const attFound = attribute.values.filter((target) => { return Object.values(values).includes(target.id); @@ -1115,6 +1119,7 @@ export class Orderline extends PosModel { valuesForOrderLine: attFound, }; listOfAttributes.push(modifiedAttribute); + addedPtal_id.push(ptal_id); } } return listOfAttributes;