diff options
| author | Jay Vora (OpenERP) <jvo@tinyerp.com> | 2011-04-11 15:59:52 +0530 |
|---|---|---|
| committer | Jay Vora (OpenERP) <jvo@tinyerp.com> | 2011-04-11 15:59:52 +0530 |
| commit | 2fe8efd42835515d9d7a6cc8e16a2bb9db311ec0 (patch) | |
| tree | 9faf6328debaaa467ad59711a4a22c2da5e9aea5 | |
| parent | 326fc1420b16e575a8f27264cf1a086c0348caf5 (diff) | |
[FIX] Stock : System should not create duplicate moves while processing with chained locations
lp bug: https://launchpad.net/bugs/722538 fixed
bzr revid: jvo@tinyerp.com-20110411102952-9lhk38kshrp8ha2p
| -rw-r--r-- | addons/stock/stock.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/addons/stock/stock.py b/addons/stock/stock.py index af1b783709e..f7d296a426e 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2108,11 +2108,11 @@ class stock_move(osv.osv): todo = [] for move in self.browse(cr, uid, ids, context=context): - #print 'DONE MOVE', move.id, move.product_id.name, move.move_dest_id.id, move.state, move.move_dest_id and move.move_dest_id.state if move.state=="draft": todo.append(move.id) if todo: self.action_confirm(cr, uid, todo, context=context) + todo = [] for move in self.browse(cr, uid, ids, context=context): if move.state in ['done','cancel']: @@ -2135,10 +2135,13 @@ 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}, context=context) - if move.state not in ('confirmed','done'): - self.action_confirm(cr, uid, move_ids, context=context) + if move.state not in ('confirmed','done','assigned'): + todo.append(move.id) + + if todo: + self.action_confirm(cr, uid, todo, context=context) - self.write(cr, uid, move_ids, {'state': 'done', 'date_planned': time.strftime('%Y-%m-%d %H:%M:%S')}, context=context) + self.write(cr, uid, move_ids, {'state': 'done', 'date': time.strftime('%Y-%m-%d %H:%M:%S')}, context=context) for id in move_ids: wf_service.trg_trigger(uid, 'stock.move', id, cr) |
