[FIX] stock_account: keep all picking origins when creating a grouped invoice
This commit is contained in:
parent
753a4d787d
commit
8de7be6219
|
@ -284,12 +284,15 @@ class stock_picking(osv.osv):
|
|||
partner, user_id, currency_id = move_obj._get_master_data(cr, uid, move, company, context=context)
|
||||
|
||||
key = (partner, currency_id, company.id, user_id)
|
||||
invoice_vals = self._get_invoice_vals(cr, uid, key, inv_type, journal_id, move, context=context)
|
||||
|
||||
if key not in invoices:
|
||||
# Get account and payment terms
|
||||
invoice_vals = self._get_invoice_vals(cr, uid, key, inv_type, journal_id, move, context=context)
|
||||
invoice_id = self._create_invoice_from_picking(cr, uid, move.picking_id, invoice_vals, context=context)
|
||||
invoices[key] = invoice_id
|
||||
else:
|
||||
invoice = invoice_obj.browse(cr, uid, invoices[key], context=context)
|
||||
invoice.write({'origin': '%s, %s' % (invoice.origin, invoice_vals['origin'],)})
|
||||
|
||||
invoice_line_vals = move_obj._get_invoice_line_vals(cr, uid, move, partner, inv_type, context=context)
|
||||
invoice_line_vals['invoice_id'] = invoices[key]
|
||||
|
|
Loading…
Reference in New Issue