diff --git a/modules/purchase_trade/purchase.py b/modules/purchase_trade/purchase.py index c58499e..5519403 100755 --- a/modules/purchase_trade/purchase.py +++ b/modules/purchase_trade/purchase.py @@ -2815,12 +2815,14 @@ class Line(metaclass=PoolMeta): 'on_change_with_attribute_set' ) - attributes_name = fields.Function( - fields.Char("Attributes Name"), - 'on_change_with_attributes_name' - ) - - finished = fields.Boolean("Mark as finished") + attributes_name = fields.Function( + fields.Char("Attributes Name"), + 'on_change_with_attributes_name' + ) + specification = fields.Function( + fields.Char("Specification"), 'on_change_with_specification') + + finished = fields.Boolean("Mark as finished") quality_analysis = fields.One2Many('quality.analysis','line',"Quality analysis") assays = fields.One2Many('assay.assay','line',"Assays") @@ -2875,9 +2877,17 @@ class Line(metaclass=PoolMeta): 'product_attribute.msg_label_value', label=attribute.string, value=attribute.format(value) - )) + )) return " | ".join(filter(None, values)) + @fields.depends( + 'product', 'attributes', + 'coffee_origin', 'coffee_type', 'coffee_process', 'coffee_variety', + 'coffee_crop_year', 'coffee_screen_size', 'coffee_moisture_max', + 'coffee_defect_max', 'coffee_cup_score_min') + def on_change_with_specification(self, name=None): + return self.on_change_with_attributes_name(name) + @fields.depends( 'quantity_theorical', 'quantity', 'lots', 'targeted_qt', methods=['_recompute_trade_price_fields']) diff --git a/modules/purchase_trade/sale.py b/modules/purchase_trade/sale.py index 5fffb98..d840807 100755 --- a/modules/purchase_trade/sale.py +++ b/modules/purchase_trade/sale.py @@ -2511,6 +2511,8 @@ class SaleLine(metaclass=PoolMeta): fields.Char("Attributes Name"), 'on_change_with_attributes_name' ) + specification = fields.Function( + fields.Char("Specification"), 'on_change_with_specification') finished = fields.Boolean("Mark as finished") pricing_rule = fields.Text("Pricing description") @@ -2657,6 +2659,14 @@ class SaleLine(metaclass=PoolMeta): )) return " | ".join(filter(None, values)) + @fields.depends( + 'product', 'attributes', + 'coffee_origin', 'coffee_type', 'coffee_process', 'coffee_variety', + 'coffee_crop_year', 'coffee_screen_size', 'coffee_moisture_max', + 'coffee_defect_max', 'coffee_cup_score_min') + def on_change_with_specification(self, name=None): + return self.on_change_with_attributes_name(name) + @fields.depends( 'quantity_theorical', 'quantity', 'lots', 'targeted_qt', methods=['_recompute_trade_price_fields']) diff --git a/modules/purchase_trade/view/purchase_line_form.xml b/modules/purchase_trade/view/purchase_line_form.xml index a9250fe..7a49bcd 100755 --- a/modules/purchase_trade/view/purchase_line_form.xml +++ b/modules/purchase_trade/view/purchase_line_form.xml @@ -27,34 +27,44 @@ this repository contains the full copyright notices and license terms. --> view_ids="purchase.product_view_list_purchase_line"/>