bzr revid: fp@tinyerp.com-20110924133601-9jqvdj1auow3glg8
This commit is contained in:
Fabien Pinckaers 2011-09-24 15:36:01 +02:00
commit 9d4aa6aa1c
1 changed files with 3 additions and 2 deletions

View File

@ -138,14 +138,15 @@ class StockMove(osv.osv):
wf_service = netsvc.LocalService("workflow")
for move in self.browse(cr, uid, ids, context=context):
new_moves = super(StockMove, self).action_scrap(cr, uid, [move.id], product_qty, location_id, context=context)
self.write(cr, uid, [move.id], {'prodlot_id': False, 'tracking_id': False})
#If we are not scrapping our whole move, tracking and lot references must not be removed
#self.write(cr, uid, [move.id], {'prodlot_id': False, 'tracking_id': False})
production_ids = production_obj.search(cr, uid, [('move_lines', 'in', [move.id])])
for prod_id in production_ids:
wf_service.trg_validate(uid, 'mrp.production', prod_id, 'button_produce', cr)
for new_move in new_moves:
production_obj.write(cr, uid, production_ids, {'move_lines': [(4, new_move)]})
res.append(new_move)
return {}
return res
StockMove()