From 24284cce3800a1d26125d5c45ffb56b07f3dd953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 16 Jun 2019 19:14:46 +0200 Subject: [PATCH] Require tax on tax line Without a proper tax, the tax line is never shown in any tax code reports. issue8364 review261511002 --- invoice.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/invoice.py b/invoice.py index 968e6d26eb..8c87ced7bc 100644 --- a/invoice.py +++ b/invoice.py @@ -2353,11 +2353,12 @@ class InvoiceTax(sequence_ordered(), ModelSQL, ModelView): if self.account.party_required: line.party = self.invoice.party line.origin = self - tax_line = TaxLine() - tax_line.amount = amount - tax_line.type = 'tax' - tax_line.tax = self.tax - line.tax_lines = [tax_line] + if self.tax: + tax_line = TaxLine() + tax_line.amount = amount + tax_line.type = 'tax' + tax_line.tax = self.tax + line.tax_lines = [tax_line] return [line] def _credit(self):