From f6b6eb906de780714b97b7ca15784d319300548b Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Mon, 14 Mar 2016 14:07:50 +0100 Subject: [PATCH] [FIX] stock_account: AML date The a product valuation is real-time, the date used is the scheduled date of the move, not the actual move processing date. This is because the date is updated on the move after the AML creation. opw-671372 Fixes #11228 --- addons/stock_account/stock_account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock_account/stock_account.py b/addons/stock_account/stock_account.py index 16b4d79c27b..f4004b824d6 100644 --- a/addons/stock_account/stock_account.py +++ b/addons/stock_account/stock_account.py @@ -337,7 +337,7 @@ class stock_quant(osv.osv): move_obj = self.pool.get('account.move') for cost, qty in quant_cost_qty.items(): move_lines = self._prepare_account_move_line(cr, uid, move, qty, cost, credit_account_id, debit_account_id, context=context) - date = context.get('force_period_date', move.date) + date = context.get('force_period_date', fields.date.context_today(self, cr, uid, context=context)) new_move = move_obj.create(cr, uid, {'journal_id': journal_id, 'line_ids': move_lines, 'date': date,