[FIX] stock_account: avoid timezone periode mismatch

The `find` method will get the current accounting periode according to the
user's timezone while time do not. This means that it is possible that users
get a move with a date belongign to a different period that the one returned by
`find`.
Fixing b101808, linked to #4147, courtesy of Graeme Gellatly
This commit is contained in:
Martin Trigaux 2015-04-10 09:50:28 +02:00
parent aa26c5a81c
commit d281e7aebd
1 changed files with 1 additions and 3 deletions

View File

@ -22,8 +22,6 @@
from openerp.osv import fields, osv
from openerp.tools.translate import _
from openerp import SUPERUSER_ID, api
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT
import time
import logging
_logger = logging.getLogger(__name__)
@ -251,7 +249,7 @@ class stock_quant(osv.osv):
move_obj.create(cr, uid, {'journal_id': journal_id,
'line_id': move_lines,
'period_id': period_id,
'date': time.strftime(DEFAULT_SERVER_DATE_FORMAT),
'date': fields.date.context_today(self, cr, uid, context=context),
'ref': move.picking_id.name}, context=context)
#def _reconcile_single_negative_quant(self, cr, uid, to_solve_quant, quant, quant_neg, qty, context=None):