From c5a31bf4b1dc03ad8f2d9d642dc3cece61ef34cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Fri, 8 Apr 2022 19:07:14 +0200 Subject: [PATCH] Send only the required fields when fetching a readonly view definition issue11134 review380081002 --- location.py | 8 +++----- product.py | 6 ++---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/location.py b/location.py index ca6dd186e0..42b0e68470 100644 --- a/location.py +++ b/location.py @@ -19,16 +19,14 @@ class ProductLocation(sequence_ordered(), ModelSQL, ModelView, MatchMixin): If(Bool(Eval('product')), ('products', '=', Eval('product')), ()), - ], - depends=['product']) + ]) product = fields.Many2One( 'product.product', "Variant", ondelete='CASCADE', select=True, domain=[ If(Bool(Eval('template')), ('template', '=', Eval('template')), ()), - ], - depends=['template']) + ]) warehouse = fields.Many2One('stock.location', 'Warehouse', required=True, domain=[('type', '=', 'warehouse')], ondelete='CASCADE') location = fields.Many2One('stock.location', 'Storage Location', @@ -37,7 +35,7 @@ class ProductLocation(sequence_ordered(), ModelSQL, ModelView, MatchMixin): ('type', '=', 'storage'), ('parent', 'child_of', If(Bool(Eval('warehouse')), [Eval('warehouse')], [])), - ], depends=['warehouse']) + ]) @classmethod def __register__(cls, module_name): diff --git a/product.py b/product.py index 3e6afd9c3e..28120a649d 100644 --- a/product.py +++ b/product.py @@ -11,8 +11,7 @@ class Template(metaclass=PoolMeta): "Default Locations", states={ 'invisible': ~Eval('type').in_(['goods', 'assets']), - }, - depends=['type']) + }) @classmethod def copy(cls, templates, default=None): @@ -48,8 +47,7 @@ class Product(metaclass=PoolMeta): ], states={ 'invisible': ~Eval('type').in_(['goods', 'assets']), - }, - depends=['type', 'template']) + }) @classmethod def copy(cls, products, default=None):