[FIX] stock_account: avoid duplicate document origin in invoice

This fix is related to 8de7be6219

opw-621962
This commit is contained in:
Denis Ledoux 2015-01-07 15:00:23 +01:00
parent 28833f070f
commit 31468888a1
1 changed files with 2 additions and 1 deletions

View File

@ -292,7 +292,8 @@ class stock_picking(osv.osv):
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'],)})
if invoice_vals['origin'] not in invoice.origin.split(', '):
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]