Use dictionary as domain for Reference field

issue11074
review383911002
This commit is contained in:
Cédric Krier committed 2022-02-03 23:05:47 +01:00
1 parent f72cdeb5de
commit 0201ff5bdd
1 file changed
+6 -19
+6 -19
View File
@@ -630,31 +630,18 @@ class CountSearch(ModelView):
('product.product', "Product"),
],
required=True,
domain=[If(Eval('search_model') == 'product.product',
[
('type', '=', 'goods'),
('consumable', '=', False),
],
[])],
depends=['search_model'],
domain={
'product.product': [
('type', '=', 'goods'),
('consumable', '=', False),
],
},
help="The item that's counted.")
search_model = fields.Function(fields.Selection(
'get_search_models', "Search Model"),
'on_change_with_search_model')
@classmethod
def default_search(cls):
return 'product.product,-1'
@classmethod
def get_search_models(cls):
return cls.fields_get(['search'])['search']['selection']
@fields.depends('search')
def on_change_with_search_model(self, name=None):
if self.search:
return self.search.__name__
class CountQuantity(ModelView):
"Stock Inventory Count"