[FIX] stock: do not remove lot id when splitting lot
Partial revert of the commit b62191c171
.
We want to keep the lot number if we don't add all the products at once.
opw-648629
Fixes #7044
This commit is contained in:
parent
085875619f
commit
186c77dad1
|
@ -1518,7 +1518,7 @@ class stock_picking(osv.osv):
|
|||
op = operation
|
||||
if (operation.qty_done < operation.product_qty):
|
||||
new_operation = stock_operation_obj.copy(cr, uid, operation.id, {'product_qty': operation.qty_done,'qty_done': operation.qty_done}, context=context)
|
||||
stock_operation_obj.write(cr, uid, operation.id, {'product_qty': operation.product_qty - operation.qty_done,'qty_done': 0, 'lot_id': False}, context=context)
|
||||
stock_operation_obj.write(cr, uid, operation.id, {'product_qty': operation.product_qty - operation.qty_done,'qty_done': 0}, context=context)
|
||||
op = stock_operation_obj.browse(cr, uid, new_operation, context=context)
|
||||
pack_operation_ids.append(op.id)
|
||||
if op.product_id and op.location_id and op.location_dest_id:
|
||||
|
@ -4097,7 +4097,7 @@ class stock_pack_operation(osv.osv):
|
|||
if pack_op.qty_done < pack_op.product_qty:
|
||||
# we split the operation in two
|
||||
op = self.copy(cr, uid, pack_op.id, {'product_qty': pack_op.qty_done, 'qty_done': pack_op.qty_done}, context=context)
|
||||
self.write(cr, uid, [pack_op.id], {'product_qty': pack_op.product_qty - pack_op.qty_done, 'qty_done': 0, 'lot_id': False}, context=context)
|
||||
self.write(cr, uid, [pack_op.id], {'product_qty': pack_op.product_qty - pack_op.qty_done, 'qty_done': 0}, context=context)
|
||||
processed_ids.append(op)
|
||||
self.write(cr, uid, processed_ids, {'processed': 'true'}, context=context)
|
||||
|
||||
|
|
Loading…
Reference in New Issue