From 46c5db095af77bd61c883c6af5f801da4da1d9da Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 23 Nov 2016 12:37:58 +0100 Subject: [PATCH] [FIX] account_tax_cash_basis: _get_tax_cash_basis_lines When refunding a supplier invoice with tax cash basis and no cash flow, a movement for the cash basis tax was created. Only entries with cash flow must be created for cash basis taxes. opw:693453 --- .../models/account_partial_reconcile.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/addons/account_tax_cash_basis/models/account_partial_reconcile.py b/addons/account_tax_cash_basis/models/account_partial_reconcile.py index f913c34bb42..b2999f421bd 100644 --- a/addons/account_tax_cash_basis/models/account_partial_reconcile.py +++ b/addons/account_tax_cash_basis/models/account_partial_reconcile.py @@ -68,14 +68,16 @@ class AccountPartialReconcileCashBasis(models.Model): # Create counterpart vals for key, v in total_by_cash_basis_account.items(): k, tax_id = key - line_to_create.append((0, 0, { - 'name': '/', - 'debit': abs(v) if v < 0 else 0.0, - 'credit': v if v > 0 else 0.0, - 'account_id': k, - 'tax_line_id': tax_id, - 'tax_exigible': True, - })) + # Only entries with cash flow must be created + if not self.company_id.currency_id.is_zero(v): + line_to_create.append((0, 0, { + 'name': '/', + 'debit': abs(v) if v < 0 else 0.0, + 'credit': v if v > 0 else 0.0, + 'account_id': k, + 'tax_line_id': tax_id, + 'tax_exigible': True, + })) return line_to_create, move_date def create_tax_cash_basis_entry(self, value_before_reconciliation):