changeset f484c5c4c023 in modules/sale_product_customer:default details: https://hg.tryton.org/modules/sale_product_customer?cmd=changeset&node=f484c5c4c023 description: Send only the required fields when fetching a readonly view definition
issue11134 review380081002 diffstat: product.py | 12 ++++-------- sale.py | 5 ++--- 2 files changed, 6 insertions(+), 11 deletions(-) diffs (65 lines): diff -r afd4ca1bdf1e -r f484c5c4c023 product.py --- a/product.py Wed Apr 06 23:37:44 2022 +0200 +++ b/product.py Fri Apr 08 19:07:14 2022 +0200 @@ -22,8 +22,7 @@ ('products', '=', Eval('product')), ()), If(Eval('active'), ('active', '=', True), ()), - ], - depends=['product', 'active']) + ]) product = fields.Many2One( 'product.product', "Variant", select=True, domain=[ @@ -31,8 +30,7 @@ ('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 @@ }, 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 @@ ], states={ 'invisible': ~Eval('salable', False), - }, - depends=['template', 'salable', 'active']) + }) def product_customer_used(self, **pattern): for product_customer in self.product_customers: diff -r afd4ca1bdf1e -r f484c5c4c023 sale.py --- a/sale.py Wed Apr 06 23:37:44 2022 +0200 +++ b/sale.py Fri Apr 08 19:07:14 2022 +0200 @@ -28,7 +28,7 @@ '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 @@ ], states={ 'invisible': Eval('action') != 'product', - }, - depends=['action', 'product', 'party']) + }) @fields.depends('line') def on_change_line(self):