[IMP] Make sure pack operations split in the correct way in the bar code interface
authorJosse Colpaert <jco@odoo.com>
Mon, 16 Jun 2014 15:07:10 +0000 (17:07 +0200)
committerJosse Colpaert <jco@odoo.com>
Mon, 16 Jun 2014 15:07:10 +0000 (17:07 +0200)
addons/stock/stock.py

index e224e55..7fade0e 100644 (file)
@@ -3823,7 +3823,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, ids, {'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, 'lot_id': False}, context=context)
             processed_ids.append(op)
         self.write(cr, uid, processed_ids, {'processed': 'true'}, context=context)