Skip to content

Commit

Permalink
[FIX] stock: service lines duplication when grouping DO invoices
Browse files Browse the repository at this point in the history
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 odoo#4201
  • Loading branch information
alexis-via authored and beledouxdenis committed Sep 25, 2015
1 parent be33912 commit fc11b58
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion addons/stock/stock.py
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,9 @@ def action_invoice_create(self, cr, uid, ids, journal_id=False,
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)
Expand Down

0 comments on commit fc11b58

Please sign in to comment.