From 186c77dad171b21590e051373de3cd51269d9b3e Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 9 Sep 2015 10:10:20 +0200 Subject: [PATCH] [FIX] stock: do not remove lot id when splitting lot Partial revert of the commit b62191c17170918f99163fe2cb648dac3a21e070. We want to keep the lot number if we don't add all the products at once. opw-648629 Fixes #7044 --- addons/stock/stock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index f25665852e5..819521ea3fd 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -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)