Skip to content
Snippets Groups Projects
Commit bb2fae9c authored by Ivan Yelizariev's avatar Ivan Yelizariev
Browse files

[FIX] sale: fix custom values order in product description


STEPS:
* activate Product Configurator
* create 3 attributes with custom values option
* create a quotation with a product having all 3 attributes and custom values
* select the custom values for attributes in different orders for each SO line

BEFORE: Product description get random order for the custom attributes list

AFTER: Order is fine

---

opw-2379778

closes odoo/odoo#61862

X-original-commit: 57eb0507
Signed-off-by: default avatarIvan Yelizariev // IEL <yelizariev@users.noreply.github.com>
parent a0e012f1
Branches
Tags
No related merge requests found
......@@ -1870,8 +1870,10 @@ class SaleOrderLine(models.Model):
for ptav in (no_variant_ptavs - custom_ptavs):
name += "\n" + ptav.with_context(lang=self.order_id.partner_id.lang).display_name
# Sort the values according to _order settings, because it doesn't work for virtual records in onchange
custom_values = sorted(self.product_custom_attribute_value_ids, key=lambda r: (r.custom_product_template_attribute_value_id.id, r.id))
# display the is_custom values
for pacv in self.product_custom_attribute_value_ids:
for pacv in custom_values:
name += "\n" + pacv.with_context(lang=self.order_id.partner_id.lang).display_name
return name
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment