Fix assignation in picking list
bzr revid: ced-333a43eeb96ca53a3f4c08350378f2815e2b7225
This commit is contained in:
parent
d38455cf2e
commit
5e5ab6dd67
|
@ -690,6 +690,7 @@ class stock_move(osv.osv):
|
||||||
#
|
#
|
||||||
def check_assign(self, cr, uid, ids, context={}):
|
def check_assign(self, cr, uid, ids, context={}):
|
||||||
done = []
|
done = []
|
||||||
|
count=0
|
||||||
pickings = {}
|
pickings = {}
|
||||||
for move in self.browse(cr, uid, ids):
|
for move in self.browse(cr, uid, ids):
|
||||||
if move.product_id.type == 'consu':
|
if move.product_id.type == 'consu':
|
||||||
|
@ -708,13 +709,16 @@ class stock_move(osv.osv):
|
||||||
move_id = self.copy(cr, uid, move.id, {'product_qty':r[0], 'location_id':r[1]})
|
move_id = self.copy(cr, uid, move.id, {'product_qty':r[0], 'location_id':r[1]})
|
||||||
done.append(move_id)
|
done.append(move_id)
|
||||||
#cr.execute('insert into stock_move_history_ids values (%d,%d)', (move.id,move_id))
|
#cr.execute('insert into stock_move_history_ids values (%d,%d)', (move.id,move_id))
|
||||||
|
if done:
|
||||||
|
count += len(done)
|
||||||
|
self.write(cr, uid, done, {'state':'assigned'})
|
||||||
|
done = []
|
||||||
|
|
||||||
if done:
|
if count:
|
||||||
self.write(cr, uid, done, {'state':'assigned'})
|
|
||||||
for pick_id in pickings:
|
for pick_id in pickings:
|
||||||
wf_service = netsvc.LocalService("workflow")
|
wf_service = netsvc.LocalService("workflow")
|
||||||
wf_service.trg_write(uid, 'stock.picking', pick_id, cr)
|
wf_service.trg_write(uid, 'stock.picking', pick_id, cr)
|
||||||
return len(done)
|
return count
|
||||||
|
|
||||||
#
|
#
|
||||||
# Cancel move => cancel others move and pickings
|
# Cancel move => cancel others move and pickings
|
||||||
|
|
Loading…
Reference in New Issue