[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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user