From 841e47a46ae65e858b2181fa74277095bf96ec85 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 4 Jun 2014 10:42:43 +0200 Subject: [PATCH] [FIX] stock: use correct vals in grouped invoice (opw 606535) When creating a grouped invoice, the invoice_vals value is used to create the invoice line. The value was not reset for grouped invoice and we reused the values of previous line. --- addons/stock/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 4c45de266d7..fa4fd3d7ffa 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1132,13 +1132,13 @@ class stock_picking(osv.osv): if not inv_type: inv_type = self._get_invoice_type(picking) + invoice_vals = self._prepare_invoice(cr, uid, picking, partner, inv_type, journal_id, context=context) if group and partner.id in invoices_group: invoice_id = invoices_group[partner.id] invoice = invoice_obj.browse(cr, uid, invoice_id) invoice_vals_group = self._prepare_invoice_group(cr, uid, picking, partner, invoice, context=context) invoice_obj.write(cr, uid, [invoice_id], invoice_vals_group, context=context) else: - invoice_vals = self._prepare_invoice(cr, uid, picking, partner, inv_type, journal_id, context=context) invoice_id = invoice_obj.create(cr, uid, invoice_vals, context=context) invoices_group[partner.id] = invoice_id res[picking.id] = invoice_id