Skip to content

[FIX] account_invoice_tax: avoid including amount_currency when not needed #211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions account_invoice_tax/wizards/account_invoice_tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,17 @@ def _get_amount_updated_values(self):
company_currency = self.invoice_tax_id.move_id.company_currency_id
not_company_currency = move_currency and move_currency != company_currency

return {
"amount_currency": self.amount if not_company_currency else None,
values = {
"debit": debit_cc if not_company_currency else debit,
"credit": credit_cc if not_company_currency else credit,
"balance": (self.amount_company_currency if not_company_currency else self.amount) * (1 if debit else -1),
}

if not_company_currency and self.amount:
values["amount_currency"] = self.amount

return values

def _compute_amount_company_currency(self):
for line in self:
taxes = line.invoice_tax_id.move_id.tax_totals["subtotals"][0]["tax_groups"]
Expand Down