[FIX] sale: add missing SO origins

When an invoice gathers multiple SO, only one SO was specified in the
origin.

opw-653598
This commit is contained in:
Nicolas Martinelli
2015-11-05 11:24:29 +01:00
parent 350ff8cfc3
commit ec76f1b3dc
+2
View File
@@ -304,6 +304,8 @@ class SaleOrder(models.Model):
inv_data = order._prepare_invoice()
invoice = inv_obj.create(inv_data)
invoices[group_key] = invoice
elif group_key in invoices and order.name not in invoices[group_key].origin.split(', '):
invoices[group_key].write({'origin': invoices[group_key].origin + ', ' + order.name})
if line.qty_to_invoice > 0:
line.invoice_line_create(invoices[group_key].id, line.qty_to_invoice)
elif line.qty_to_invoice < 0 and final: