Skip to content

Commit

Permalink
[FIX] l10n_br_account: dont update tax_ids for posted move
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniospneto committed Jul 20, 2023
1 parent 8f166fc commit f88783b
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions l10n_br_account/models/account_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,15 +453,18 @@ def _update_taxes(self):
os impostos contábeis relacionados"""
result = super()._update_taxes()

# Atualiza os impostos contábeis relacionados aos impostos fiscais
user_type = "sale"
if self.move_id.move_type in ("in_invoice", "in_refund"):
user_type = "purchase"

self.tax_ids = self.fiscal_tax_ids.account_taxes(
user_type=user_type, fiscal_operation=self.fiscal_operation_id
)
self._onchange_mark_recompute_taxes()
if self.parent_state != "posted":
# Atualiza os impostos contábeis relacionados aos impostos fiscais
user_type = "sale"
if self.move_id.move_type in ("in_invoice", "in_refund"):
user_type = "purchase"

self.tax_ids = self.fiscal_tax_ids.with_context(
default_company_id=self.move_id.company_id.id
).account_taxes(
user_type=user_type, fiscal_operation=self.fiscal_operation_id
)
self._onchange_mark_recompute_taxes()

return result

Expand Down

0 comments on commit f88783b

Please sign in to comment.