From 97a7cce164b65aedbbfbf7ed1d67d5afb92784ce Mon Sep 17 00:00:00 2001 From: Maulik Raval Date: Thu, 30 Jan 2020 06:22:48 +0000 Subject: [PATCH] [FIX]Fixed the singleton error when updating multiple category records value. closes odoo/odoo#44320 X-original-commit: b08f658770d97be73da540eae1b439c551784310 Signed-off-by: Simon Lejeune (sle) --- addons/stock_account/models/product.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock_account/models/product.py b/addons/stock_account/models/product.py index 97b08f5fff1..031cb5bc85e 100644 --- a/addons/stock_account/models/product.py +++ b/addons/stock_account/models/product.py @@ -721,10 +721,10 @@ class ProductCategory(models.Model): # Empty out the stock with the current cost method. if new_cost_method: description = _("Costing method change for product category %s: from %s to %s.") \ - % (self.display_name, self.property_cost_method, new_cost_method) + % (product_category.display_name, product_category.property_cost_method, new_cost_method) else: description = _("Valuation method change for product category %s: from %s to %s.") \ - % (self.display_name, self.property_valuation, new_valuation) + % (product_category.display_name, product_category.property_valuation, new_valuation) out_svl_vals_list, products_orig_quantity_svl, products = Product\ ._svl_empty_stock(description, product_category=product_category) out_stock_valuation_layers = SVL.sudo().create(out_svl_vals_list)