From a2e0c36a3c384b50c4a2de1ada13c949573a2697 Mon Sep 17 00:00:00 2001 From: laurentbarontini Date: Fri, 20 Mar 2026 13:50:31 +0100 Subject: [PATCH] 20.03.26 --- modules/price/price.py | 24 ++++++++++++++++++++ modules/price/view/product_form.xml | 4 ++-- modules/price/view/product_tree_sequence.xml | 2 +- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/modules/price/price.py b/modules/price/price.py index ac764d0..2a93fa0 100755 --- a/modules/price/price.py +++ b/modules/price/price.py @@ -148,6 +148,30 @@ class Product(ModelSQL,ModelView): 'on_change_with_attribute_set' ) + attributes_name = fields.Function( + fields.Char("Details"), + 'on_change_with_attributes_name' + ) + + @fields.depends('product', 'attributes') + def on_change_with_attributes_name(self, name=None): + if not self.product or not self.product.attribute_set or not self.attributes: + return + + def key(attribute): + return getattr(attribute, 'sequence', attribute.name) + + values = [] + for attribute in sorted(self.product.attribute_set.attributes, key=key): + if attribute.name in self.attributes: + value = self.attributes[attribute.name] + values.append(gettext( + 'product_attribute.msg_label_value', + label=attribute.string, + value=attribute.format(value) + )) + return " | ".join(filter(None, values)) + @fields.depends('product') def on_change_with_attribute_set(self, name=None): if self.product and self.product.template and self.product.template.attribute_set: diff --git a/modules/price/view/product_form.xml b/modules/price/view/product_form.xml index 62bdb1c..cc86590 100755 --- a/modules/price/view/product_form.xml +++ b/modules/price/view/product_form.xml @@ -1,6 +1,6 @@
-