Skip to content

Commit

Permalink
IMP l10n_it_account adding _get_tax_amount to be used by electronic i…
Browse files Browse the repository at this point in the history
…nvoices (OCA#606)
  • Loading branch information
eLBati authored and TonyMasciI committed Jan 9, 2023
1 parent 5745932 commit 833f338
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions l10n_it_account/models/account_tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ class AccountTax(models.Model):
'account.tax', 'account_tax_filiation_rel', 'child_tax', 'parent_tax',
string='Parent Taxes')

def _get_tax_amount(self):
self.ensure_one()
res = 0.0
if self.amount_type == 'group':
for child in self.children_tax_ids:
res += child.amount
else:
res = self.amount
return res

def _get_tax_name(self):
self.ensure_one()
name = self.name
Expand Down

0 comments on commit 833f338

Please sign in to comment.