Enforce currency, invoice_type and party values between invoice and lines

The currency of an invoice line must always be the same as the invoice.
For the invoice_type and party they must be the same only if set.

issue9854
review324581002
This commit is contained in:
Cédric Krier committed 2020-12-16 21:24:07 +01:00
1 parent 3344e54b4c
commit 7bb221bad3
1 file changed
+2
+2
View File
@@ -1451,6 +1451,8 @@ class SaleLine(sequence_ordered(), ModelSQL, ModelView):
invoice_line.unit_price = self.unit_price
invoice_line.taxes = self.taxes
invoice_line.invoice_type = 'out'
invoice_line.currency = self.currency
invoice_line.company = self.company
if self.product:
invoice_line.account = self.product.account_revenue_used
if not invoice_line.account: