[FIX] sale: when creating the invoice, call the additional fields helper function

This function is there to avoid creating link modules, it is extended
by account modules and should be called by methods that create invoices.

This call was missing in sale.
This commit is contained in:
Damien Bouvy
2016-02-26 09:15:36 +01:00
parent 550fa2650a
commit 89df4aa5ec
+3
View File
@@ -319,6 +319,9 @@ class SaleOrder(models.Model):
invoice.type = 'out_refund'
for line in invoice.invoice_line_ids:
line.quantity = -line.quantity
# Use additional field helper function (for account extensions)
for line in invoice.invoice_line_ids:
line._set_additional_fields(invoice)
# Necessary to force computation of taxes. In account_invoice, they are triggered
# by onchanges, which are not triggered when doing a create.
invoice.compute_taxes()