[FIX]: mrp: "Consume products" in Production order creates 2 records

lp bug: https://launchpad.net/bugs/667327 fixed

bzr revid: rpa@tinyerp.com-20101203092226-xe490fnzq027sapt
This commit is contained in:
rpa (Open ERP)
2010-12-03 14:52:26 +05:30
parent 68880fdc90
commit c511a13c19
+3
View File
@@ -113,6 +113,9 @@ class StockMove(osv.osv):
production_obj.force_production(cr, uid, [prod.id])
wf_service.trg_validate(uid, 'mrp.production', prod.id, 'button_produce', cr)
for new_move in new_moves:
if new_move == move.id:
#This move is already there in move lines of production order
continue
production_obj.write(cr, uid, production_ids, {'move_lines': [(4, new_move)]})
res.append(new_move)
return res