[FIX] stock: service lines duplication when grouping DO invoices
This is possible that changes happen during the loop in the multiple pickings: an update in a picking could update another picking. The browse must therefore be done inside the loop to update the pickings with the latest changes. Fixes #4201
This commit is contained in:
parent
be33912a25
commit
fc11b58239
|
@ -1132,7 +1132,9 @@ class stock_picking(osv.osv):
|
||||||
invoices_group = {}
|
invoices_group = {}
|
||||||
res = {}
|
res = {}
|
||||||
inv_type = type
|
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':
|
if picking.invoice_state != '2binvoiced':
|
||||||
continue
|
continue
|
||||||
partner = self._get_partner_to_invoice(cr, uid, picking, context=context)
|
partner = self._get_partner_to_invoice(cr, uid, picking, context=context)
|
||||||
|
|
Loading…
Reference in New Issue