From 0c8de4cda1b0aede41ddaea771845f97639c1dd7 Mon Sep 17 00:00:00 2001 From: Maxime Richez Date: Sun, 11 Jul 2021 11:26:46 +0200 Subject: [PATCH] Add domain to cost_price_method depending of type issue9720 --- CHANGELOG | 2 ++ product.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 82c4f3fc6b..c05067019b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,2 +1,4 @@ +* Allow only fixed cost price as method for kit + Version 6.0.0 - 2021-05-03 * Initial release diff --git a/product.py b/product.py index ab6f46a16c..743122cd1c 100644 --- a/product.py +++ b/product.py @@ -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()