From 6670369ed3b36bcdc69fb27f7135b92351fa430c Mon Sep 17 00:00:00 2001 From: Lara Baggio Date: Thu, 25 May 2017 14:13:08 +0200 Subject: [PATCH] add condition tax_exigible in domain variable --- account_tax_balance/models/account_tax.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/account_tax_balance/models/account_tax.py b/account_tax_balance/models/account_tax.py index 9af72d21..81344736 100644 --- a/account_tax_balance/models/account_tax.py +++ b/account_tax_balance/models/account_tax.py @@ -132,6 +132,7 @@ class AccountTax(models.Model): # balance is debit - credit whereas on tax return you want to see what # vat has to be paid so: # VAT on sales (credit) - VAT on purchases (debit). + balance = self.env['account.move.line'].\ read_group(domain, ['balance'], [])[0]['balance'] return balance and -balance or 0 @@ -140,6 +141,7 @@ class AccountTax(models.Model): domain = [ ('move_id.state', 'in', state_list), ('tax_line_id', '=', self.id), + ('tax_exigible', '=', True) ] if type_list: domain.append(('move_id.move_type', 'in', type_list)) @@ -149,6 +151,7 @@ class AccountTax(models.Model): domain = [ ('move_id.state', 'in', state_list), ('tax_ids', 'in', self.id), + ('tax_exigible', '=', True) ] if type_list: domain.append(('move_id.move_type', 'in', type_list))