From 0ca4b0f373d19fcfb32c7f4db6a8cf16ec1feb58 Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Wed, 22 Nov 2017 11:52:35 +0100 Subject: [PATCH] [REF] stock_account: warn when changing cost method --- addons/stock_account/models/product.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/addons/stock_account/models/product.py b/addons/stock_account/models/product.py index 883a4b48ff9..f457f25c884 100644 --- a/addons/stock_account/models/product.py +++ b/addons/stock_account/models/product.py @@ -234,3 +234,13 @@ class ProductCategory(models.Model): 'account.account', 'Stock Valuation Account', company_dependent=True, domain=[('deprecated', '=', False)], help="When real-time inventory valuation is enabled on a product, this account will hold the current value of the products.",) + + @api.onchange('property_cost_method') + def onchange_property_valuation(self): + return { + 'warning': { + 'title': _("Warning"), + 'message': _("Changing your cost method is an important change that will impact your inventory valuation. Are you sure you want to make that change?"), + } + } +