add condition tax_exigible in domain variable

pull/468/head
Lara Baggio 2017-05-25 14:13:08 +02:00 committed by Andrea
parent c552448072
commit ddd097084c
1 changed files with 3 additions and 0 deletions

View File

@ -132,6 +132,7 @@ class AccountTax(models.Model):
# balance is debit - credit whereas on tax return you want to see what # balance is debit - credit whereas on tax return you want to see what
# vat has to be paid so: # vat has to be paid so:
# VAT on sales (credit) - VAT on purchases (debit). # VAT on sales (credit) - VAT on purchases (debit).
balance = self.env['account.move.line'].\ balance = self.env['account.move.line'].\
read_group(domain, ['balance'], [])[0]['balance'] read_group(domain, ['balance'], [])[0]['balance']
return balance and -balance or 0 return balance and -balance or 0
@ -140,6 +141,7 @@ class AccountTax(models.Model):
domain = [ domain = [
('move_id.state', 'in', state_list), ('move_id.state', 'in', state_list),
('tax_line_id', '=', self.id), ('tax_line_id', '=', self.id),
('tax_exigible', '=', True)
] ]
if type_list: if type_list:
domain.append(('move_id.move_type', 'in', type_list)) domain.append(('move_id.move_type', 'in', type_list))
@ -149,6 +151,7 @@ class AccountTax(models.Model):
domain = [ domain = [
('move_id.state', 'in', state_list), ('move_id.state', 'in', state_list),
('tax_ids', 'in', self.id), ('tax_ids', 'in', self.id),
('tax_exigible', '=', True)
] ]
if type_list: if type_list:
domain.append(('move_id.move_type', 'in', type_list)) domain.append(('move_id.move_type', 'in', type_list))