From 8ef590bb28940dd692eec67c87bba6b6a88ab561 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 16 Sep 2015 11:07:14 +0200 Subject: [PATCH] [FIX] stock_account: stock inventory valuation The function "open_table" is not called when triggering the action window "Current Inventory Valuation". Then the 'history_date' is not set in the context. opw:649168 --- addons/stock_account/wizard/stock_valuation_history.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/stock_account/wizard/stock_valuation_history.py b/addons/stock_account/wizard/stock_valuation_history.py index 6856940c0b6..b86173ba3b1 100644 --- a/addons/stock_account/wizard/stock_valuation_history.py +++ b/addons/stock_account/wizard/stock_valuation_history.py @@ -1,4 +1,5 @@ +from datetime import datetime from openerp import tools from openerp.osv import fields, osv from openerp.tools.translate import _ @@ -45,7 +46,7 @@ class stock_history(osv.osv): res = super(stock_history, self).read_group(cr, uid, domain, fields, groupby, offset=offset, limit=limit, context=context, orderby=orderby, lazy=lazy) if context is None: context = {} - date = context.get('history_date') + date = context.get('history_date', datetime.now()) if 'inventory_value' in fields: group_lines = {} for line in res: