[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
This commit is contained in:
Goffin Simon 2015-09-16 11:07:14 +02:00
parent 40c35fb48a
commit 8ef590bb28
1 changed files with 2 additions and 1 deletions

View File

@ -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: