[FIX] stock: stock valuation user timezone date

When delivering a delivery order (`stock.picking.out`),
which generates accounting entries
e.g. thanks to the real-time stock valuation,
the date of the move set was the UTC today date, while it must
be the user's today date, using the timezone passed in the
context.

This prevented the delivery of the `stock.picking.out`
when the `Check date in period` boolean was checked
in the stock journal, and the user date is in the previous
month compared to the UTC date, as the date set on the move
entries were not in the selected period for these move entries.
e.g. When the user timezone is UTC -8, and his current time is
2016-02-29 18:00:00, the UTC date is 2016-03-01 02:00:00, the
period chosen is February (correct), but the date on the move
entries were set to 2016-03-01.

opw-670820
This commit is contained in:
Denis Ledoux 2016-02-29 18:25:49 -07:00
parent 8c278a4e4a
commit 3bc7ea6bcf
1 changed files with 2 additions and 2 deletions

View File

@ -2500,7 +2500,7 @@ class stock_move(osv.osv):
'product_id': move.product_id and move.product_id.id or False,
'quantity': move.product_qty,
'ref': move.picking_id and move.picking_id.name or False,
'date': time.strftime('%Y-%m-%d'),
'date': fields.date.context_today(self, cr, uid),
'partner_id': partner_id,
'debit': reference_amount,
'account_id': dest_account_id,
@ -2510,7 +2510,7 @@ class stock_move(osv.osv):
'product_id': move.product_id and move.product_id.id or False,
'quantity': move.product_qty,
'ref': move.picking_id and move.picking_id.name or False,
'date': time.strftime('%Y-%m-%d'),
'date': fields.date.context_today(self, cr, uid),
'partner_id': partner_id,
'credit': reference_amount,
'account_id': src_account_id,