[FIX] account_tax_balance: Recompute balance for different dates

This commit is contained in:
SimoRubi
2021-12-09 16:08:57 +01:00
committed by Borruso
parent d4ddec2d4d
commit b446a9ebc9
3 changed files with 50 additions and 2 deletions

View File

@@ -81,6 +81,12 @@ class AccountTax(models.Model):
ids_with_moves = self._account_tax_ids_with_moves()
return [("id", "in", ids_with_moves)]
@api.depends_context(
"from_date",
"to_date",
"company_ids",
"target_move",
)
def _compute_balance(self):
for tax in self:
tax.balance_regular = tax.compute_balance(