summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Lejeune <sle@openerp.com>2017-11-22 11:52:35 +0100
committerSimon Lejeune <sle@openerp.com>2017-11-28 15:17:59 +0100
commit0ca4b0f373d19fcfb32c7f4db6a8cf16ec1feb58 (patch)
tree4983f40f328072fda57da09ec58a6b665c1f4c2d
parent5851a69aa3ac2b140ffccdbe43427cdad3e74e0c (diff)
[REF] stock_account: warn when changing cost method
-rw-r--r--addons/stock_account/models/product.py10
1 files changed, 10 insertions, 0 deletions
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?"),
+ }
+ }
+