diff options
| author | nel@tinyerp.com <> | 2010-06-07 16:26:20 +0200 |
|---|---|---|
| committer | nel@tinyerp.com <> | 2010-06-07 16:26:20 +0200 |
| commit | b5ed5d2ccad62da30eb92e76c8f43611dfc232fd (patch) | |
| tree | c6dd25f5b0684f316fcf1d9f70606174c6ec7f97 | |
| parent | 0054c616bfeb6f0d2df28624f75153b51c0e035d (diff) | |
[FIX] stock: split production lots
bzr revid: nel@tinyerp.com-20100607142620-26gm67x3n6bs4rlw
| -rw-r--r-- | addons/stock/wizard/stock_move.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/addons/stock/wizard/stock_move.py b/addons/stock/wizard/stock_move.py index 00b7b616aa5..aa7bb42cf8b 100644 --- a/addons/stock/wizard/stock_move.py +++ b/addons/stock/wizard/stock_move.py @@ -258,7 +258,7 @@ class split_in_production_lot(osv.osv_memory): quantity_rest -= quantity uos_qty = quantity / move_qty * move.product_uos_qty uos_qty_rest = quantity_rest / move_qty * move.product_uos_qty - if quantity_rest <= 0: + if quantity_rest < 0: quantity_rest = quantity break default_val = { @@ -266,8 +266,11 @@ class split_in_production_lot(osv.osv_memory): 'product_uos_qty': uos_qty, 'state': move.state } - current_move = move_obj.copy(cr, uid, move.id, default_val) - new_move.append(current_move) + if quantity_rest > 0: + current_move = move_obj.copy(cr, uid, move.id, default_val) + new_move.append(current_move) + if quantity_rest == 0: + current_move = move.id prodlot_id = False if line.use_exist and line.name: prodlot_id = prodlot_obj.search(cr, uid, [('prefix','=',line.name),('product_id','=',data.product_id.id)]) |
