From 98e9aaf7f2e2a0eadfe9c666817a4a3b2c7b5879 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Tue, 22 Feb 2011 15:09:36 +0100 Subject: [PATCH] [FIX] stock: applied xrg patch to fix the too slow processing of large pickings lp bug: https://launchpad.net/bugs/709575 fixed bzr revid: qdp-launchpad@openerp.com-20110222140936-uw5ayii7ifn2bh2t --- addons/stock/stock.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index c942818a3d4..c3507781b12 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2113,6 +2113,7 @@ class stock_move(osv.osv): 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']: @@ -2131,12 +2132,16 @@ class stock_move(osv.osv): if move.move_dest_id.auto_validate: self.action_done(cr, uid, [move.move_dest_id.id], context=context) + # ?? do we need to invalidate the browse_record? self._create_product_valuation_moves(cr, uid, move, context=context) 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) + 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) for id in move_ids: