Send only the required fields when fetching a readonly view definition

issue11134
review380081002
This commit is contained in:
Nicolas Évrard
2022-04-08 19:07:14 +02:00
parent 7f610f9049
commit 6f82dfa4d3
3 changed files with 8 additions and 12 deletions
-1
View File
@@ -25,7 +25,6 @@ class Product(metaclass=PoolMeta):
states={
'invisible': ~Eval('salable'),
},
depends=['salable'],
help="The list of web shops on which the product is published.")
+1 -2
View File
@@ -21,8 +21,7 @@ class Sale(metaclass=PoolMeta):
states={
'required': Bool(Eval('web_shop')),
'readonly': ~Eval('web_id'),
},
depends=['web_shop'])
})
@classmethod
def __setup__(cls):
+7 -9
View File
@@ -69,7 +69,7 @@ class Shop(DeactivableMixin, ModelSQL, ModelView):
context={
'company': Eval('company', -1),
},
depends=['company'])
depends={'company'})
products = fields.Many2Many(
'web.shop-product.product', 'shop', 'product', "Products",
@@ -79,14 +79,14 @@ class Shop(DeactivableMixin, ModelSQL, ModelView):
context={
'company': Eval('company', -1),
},
depends=['company'],
depends={'company'},
help="The list of products to publish.")
products_removed = Many2ManyInactive(
'web.shop-product.product', 'shop', 'product', "Products Removed",
context={
'company': Eval('company', -1),
},
depends=['company'],
depends={'company'},
help="The list of products to unpublish.")
categories = fields.Many2Many(
@@ -94,14 +94,14 @@ class Shop(DeactivableMixin, ModelSQL, ModelView):
context={
'company': Eval('company', -1),
},
depends=['company'],
depends={'company'},
help="The list of categories to publish.")
categories_removed = Many2ManyInactive(
'web.shop-product.category', 'shop', 'category', "Categories Removed",
context={
'company': Eval('company', -1),
},
depends=['company'],
depends={'company'},
help="The list of categories to unpublish.")
_name_cache = Cache('web.shop.name', context=False)
@@ -325,12 +325,10 @@ class User(metaclass=PoolMeta):
domain=['OR',
('party', '=', Eval('party', -1)),
('party', 'in', Eval('secondary_parties', [])),
],
depends=['party', 'secondary_parties'])
])
shipment_address = fields.Many2One(
'party.address', "Shipment Address",
domain=['OR',
('party', '=', Eval('party', -1)),
('party', 'in', Eval('secondary_parties', [])),
],
depends=['party', 'secondary_parties'])
])