diff --git a/product.py b/product.py index f4df8d4a3b..81b35b44b8 100644 --- a/product.py +++ b/product.py @@ -22,8 +22,7 @@ class ProductCustomer( ('products', '=', Eval('product')), ()), If(Eval('active'), ('active', '=', True), ()), - ], - depends=['product', 'active']) + ]) product = fields.Many2One( 'product.product', "Variant", select=True, domain=[ @@ -31,8 +30,7 @@ class ProductCustomer( ('template', '=', Eval('template')), ()), If(Eval('active'), ('active', '=', True), ()), - ], - depends=['template', 'active']) + ]) party = fields.Many2One('party.party', "Customer", required=True, ondelete='CASCADE') name = fields.Char("Name", translate=True) @@ -88,8 +86,7 @@ class Template(metaclass=PoolMeta): }, domain=[ If(~Eval('active'), ('active', '=', False), ()), - ], - depends=['salable', 'active']) + ]) def product_customer_used(self, **pattern): for product_customer in self.product_customers: @@ -132,8 +129,7 @@ class Product(metaclass=PoolMeta): ], states={ 'invisible': ~Eval('salable', False), - }, - depends=['template', 'salable', 'active']) + }) def product_customer_used(self, **pattern): for product_customer in self.product_customers: diff --git a/sale.py b/sale.py index d60c720e50..0ae7f863fd 100644 --- a/sale.py +++ b/sale.py @@ -28,7 +28,7 @@ class Line(metaclass=PoolMeta): 'invisible': Eval('type') != 'line', 'readonly': Eval('sale_state') != 'draft', }, - depends=['product', 'type', 'sale_state', 'sale']) + depends={'sale'}) @fields.depends('sale', '_parent_sale.party') def _get_product_customer_pattern(self): @@ -80,8 +80,7 @@ class AmendmentLine(metaclass=PoolMeta): ], states={ 'invisible': Eval('action') != 'product', - }, - depends=['action', 'product', 'party']) + }) @fields.depends('line') def on_change_line(self):