[FIX] stock: do not overwrite date_done when a backorder is created

When the user specifies a Date of Transfer ('date_done') and only transfers the
order partially, we must keep the value instead of overwriting with today's
date.

opw-646908
This commit is contained in:
Nicolas Martinelli
2015-08-10 11:28:44 +02:00
parent 59fef0db21
commit fb3dd3f0f4
+2 -1
View File
@@ -982,7 +982,8 @@ class stock_picking(osv.osv):
move_obj = self.pool.get("stock.move")
move_obj.write(cr, uid, backorder_move_ids, {'picking_id': backorder_id}, context=context)
self.write(cr, uid, [picking.id], {'date_done': time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)}, context=context)
if not picking.date_done:
self.write(cr, uid, [picking.id], {'date_done': time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)}, context=context)
self.action_confirm(cr, uid, [backorder_id], context=context)
return backorder_id
return False