diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 276e24b4e2d..7fa2f4e92a2 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1132,7 +1132,9 @@ class stock_picking(osv.osv): invoices_group = {} res = {} inv_type = type - for picking in self.browse(cr, uid, ids, context=context): + for picking_id in ids: + # The browse inside the loop is done on purpose, as a change in the pickings during the loop is possible + picking = self.browse(cr, uid, picking_id, context=context) if picking.invoice_state != '2binvoiced': continue partner = self._get_partner_to_invoice(cr, uid, picking, context=context)