[FIX]:done moves should not be re-considered while completing production order
lp bug: https://launchpad.net/bugs/677437 fixed bzr revid: ksa@tinyerp.co.in-20101207113929-m49jn0ss1r6esf2r
This commit is contained in:
parent
261e1c163e
commit
c1692f1459
|
@ -2000,6 +2000,7 @@ class stock_move(osv.osv):
|
|||
"""
|
||||
partial_datas=''
|
||||
picking_ids = []
|
||||
move_ids = []
|
||||
partial_obj=self.pool.get('stock.partial.picking')
|
||||
partial_id=partial_obj.search(cr,uid,[])
|
||||
if partial_id:
|
||||
|
@ -2015,6 +2016,10 @@ class stock_move(osv.osv):
|
|||
self.action_confirm(cr, uid, todo, context=context)
|
||||
|
||||
for move in self.browse(cr, uid, ids):
|
||||
if move.state in ['done','cancel']:
|
||||
continue
|
||||
move_ids.append(move.id)
|
||||
|
||||
if move.picking_id:
|
||||
picking_ids.append(move.picking_id.id)
|
||||
if move.move_dest_id.id and (move.state != 'done'):
|
||||
|
@ -2031,10 +2036,11 @@ class stock_move(osv.osv):
|
|||
prodlot_id =partial_datas and partial_datas.get('move%s_prodlot_id'%(move.id), False)
|
||||
if prodlot_id:
|
||||
self.write(cr, uid, [move.id], {'prodlot_id': prodlot_id})
|
||||
self.write(cr, uid, ids, {'state': 'done', 'date': time.strftime('%Y-%m-%d %H:%M:%S')})
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for id in ids:
|
||||
wf_service.trg_trigger(uid, 'stock.move', id, cr)
|
||||
if move_ids:
|
||||
self.write(cr, uid, move_ids, {'state': 'done', 'date_planned': time.strftime('%Y-%m-%d %H:%M:%S')})
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for id in move_ids:
|
||||
wf_service.trg_trigger(uid, 'stock.move', id, cr)
|
||||
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for pick_id in picking_ids:
|
||||
|
|
Loading…
Reference in New Issue