Add domain to cost_price_method depending of type
issue9720
This commit is contained in:
1 parent
96737cef86
commit
0c8de4cda1
2 files changed
+8
No files matched your search
@@ -1,2 +1,4 @@
|
||||
* Allow only fixed cost price as method for kit
|
||||
|
||||
Version 6.0.0 - 2021-05-03
|
||||
* Initial release
|
||||
@@ -21,6 +21,12 @@ class Template(metaclass=PoolMeta):
|
||||
super().__setup__()
|
||||
cls.type.selection.append(('kit', "Kit"))
|
||||
|
||||
@classmethod
|
||||
def _cost_price_method_domain_per_type(cls):
|
||||
types_cost_method = super()._cost_price_method_domain_per_type()
|
||||
types_cost_method['kit'] = [('cost_price_method', '=', 'fixed')]
|
||||
return types_cost_method
|
||||
|
||||
@fields.depends('type', 'cost_price_method')
|
||||
def on_change_type(self):
|
||||
super().on_change_type()
|
||||
|
||||
Reference in new issue
Block a user