Send only the required fields when fetching a readonly view definition
issue11134 review380081002
This commit is contained in:
1 parent
f404481d28
commit
4207e8d337
2 files changed
+6
-11
No files matched your search
+4
-8
@@ -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:
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user