Skip to content

Commit

Permalink
[FIX] l10n_it_withholding_tax: fix for OCA#2345
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMule71 committed Nov 2, 2022
1 parent c4a6e50 commit 4be0a4e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions l10n_it_withholding_tax/models/withholding_tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ def _compute_get_rate(self):
wt.base = rate[1]

def _default_wt_journal(self):
misc_journal = self.env["account.journal"].search([("code", "=", _("MISC"))])
misc_journal = self.env["account.journal"].search(
[("code", "=", _("MISC")), ("company_id", "=", self.env.company.id)]
)
if misc_journal:
return misc_journal[0].id
return False
Expand Down Expand Up @@ -105,7 +107,7 @@ def compute_tax(self, amount):
if self.env.context.get("currency_id"):
currency = self.env["res.currency"].browse(self.env.context["currency_id"])
else:
currency = self.env.user.company_id.currency_id
currency = self.env.company.currency_id
prec = currency.decimal_places
base = round(amount * self.base, prec)
tax = round(base * ((self.tax or 0.0) / 100.0), prec)
Expand Down

0 comments on commit 4be0a4e

Please sign in to comment.