From d35bf53b509ca8312d1be3c6d61d9bd60f496ecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 3 Apr 2021 14:27:10 +0200 Subject: [PATCH] Add company pattern to multivalue calls issue10162 review335761002 --- invoice.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/invoice.py b/invoice.py index d8659055cb..246a4323ba 100644 --- a/invoice.py +++ b/invoice.py @@ -883,6 +883,8 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin): context = {} if self.party and self.party.lang: context['language'] = self.party.lang.code + if self.company: + context['company'] = self.company.id return context def _compute_taxes(self): @@ -2037,7 +2039,10 @@ class InvoiceLine(sequence_ordered(), ModelSQL, ModelView, TaxableMixin): if self.invoice: return self.invoice._get_tax_context() else: - return {} + context = {} + if self.company: + context['company'] = self.company.id + return context def get_invoice_taxes(self, name): if not self.invoice: