diff --git a/addons/stock_account/models/product.py b/addons/stock_account/models/product.py index a81b0260253..6f0c4e7a351 100644 --- a/addons/stock_account/models/product.py +++ b/addons/stock_account/models/product.py @@ -40,7 +40,7 @@ class ProductTemplate(models.Model): @api.one @api.depends('property_valuation', 'categ_id.property_valuation') def _compute_valuation_type(self): - self.valuation = self.property_valuation if self.property_valuation else self.categ_id.property_valuation + self.valuation = self.property_valuation or self.categ_id.property_valuation @api.one def _set_valuation_type(self): @@ -49,7 +49,7 @@ class ProductTemplate(models.Model): @api.one @api.depends('property_cost_method', 'categ_id.property_cost_method') def _compute_cost_method(self): - self.cost_method = self.property_cost_method if self.property_cost_method else self.categ_id.property_cost_method + self.cost_method = self.property_cost_method or self.categ_id.property_cost_method @api.one def _set_cost_method(self): @@ -57,9 +57,8 @@ class ProductTemplate(models.Model): @api.onchange('type') def onchange_type_valuation(self): - if self.type != 'product': - self.valuation = 'manual_periodic' - return {} + # TO REMOVE IN MASTER + pass @api.multi def _get_product_accounts(self): @@ -90,9 +89,8 @@ class ProductProduct(models.Model): @api.onchange('type') def onchange_type_valuation(self): - if self.type != 'product': - self.valuation = 'manual_periodic' - return {} + # TO REMOVE IN MASTER + pass @api.multi def do_change_standard_price(self, new_price, account_id): diff --git a/addons/stock_account/views/product_views.xml b/addons/stock_account/views/product_views.xml index ef1ef186508..dc831fc9bba 100644 --- a/addons/stock_account/views/product_views.xml +++ b/addons/stock_account/views/product_views.xml @@ -33,8 +33,8 @@ - - + +