Skip to content
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

[16.0][FIX] l10n_br_account: fix undef tax_ids #3574

Merged
merged 1 commit into from
Jan 9, 2025
Merged
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
20 changes: 7 additions & 13 deletions l10n_br_account/models/account_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,10 @@ def changed(fname):
if line.cfop_id and not line.cfop_id.finance_move:
unsigned_amount_currency = 0
if not line.move_id.fiscal_operation_id.deductible_taxes:
# Quando não há financeiro associado, mas há impostos e
# nenhum imposto dedutível, é necessário registrar a
# contrapartida dos impostos para manter o balanço contábil
# equilibrado. Na versão 14 do Odoo, essa diferença era
# automaticamente alocada às contas associadas aos termos
# de pagamento.
# When there is no financial amount but there are non
# dectutible taxes, then we should take the total tax
# amount into account here to keep the move balanced.
# (In v14 that was done automatically in the payment terms)
unsigned_amount_currency = -(
line.amount_tax_included
+ line.amount_tax_not_included
Expand Down Expand Up @@ -553,10 +551,6 @@ def _get_computed_taxes(self):
elif self.move_id.is_purchase_document(include_receipts=True):
user_type = "purchase"

# Retrieve taxes based on user type and fiscal operation.
if user_type:
tax_ids = self.fiscal_tax_ids.account_taxes(
user_type=user_type, fiscal_operation=self.fiscal_operation_id
)

return tax_ids
return self.fiscal_tax_ids.account_taxes(
user_type=user_type, fiscal_operation=self.fiscal_operation_id
)
Loading