From 0fa98ddc665aba409cf3480afcf50ffa2f79946e Mon Sep 17 00:00:00 2001 From: Korbinian Preisler Date: Thu, 11 Nov 2010 20:14:00 +0100 Subject: [PATCH] do not create move line for tax if the amount is 0 --- invoice.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/invoice.py b/invoice.py index dc621eb49d..c7d225a507 100644 --- a/invoice.py +++ b/invoice.py @@ -723,7 +723,8 @@ class Invoice(ModelWorkflow, ModelSQL, ModelView): res = [] for tax in invoice.taxes: val = tax_obj.get_move_line(tax) - res.append(val) + if val: + res.append(val) return res def _get_move_line(self, invoice, date, amount): @@ -1866,6 +1867,8 @@ class InvoiceTax(ModelSQL, ModelView): ''' currency_obj = self.pool.get('currency.currency') res = {} + if not tax.amount: + return res res['name'] = tax.description if tax.invoice.currency.id != tax.invoice.company.currency.id: amount = currency_obj.compute(tax.invoice.currency, tax.amount,