Skip to content

Commit

Permalink
[FIX]l10n_ar_account_withholding: add tax_rep_lines_to_recompute to _…
Browse files Browse the repository at this point in the history
…recompute_tax_lines method

closes #347

Ticket: 53172
Related: ingadhoc/odoo-argentina#621
Signed-off-by: Katherine Zaoral <[email protected]>
  • Loading branch information
Pablo Montenegro committed Jul 4, 2022
1 parent bb2e161 commit 33ec23b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions account_ux/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def unlink(self):
self.mapped('line_ids.statement_line_id').write({'move_name': False})
return super().unlink()

def _recompute_tax_lines(self, recompute_tax_base_amount=False):
def _recompute_tax_lines(self, recompute_tax_base_amount=False, tax_rep_lines_to_recompute=None):
""" Odoo recomputa todos los impuestos cada vez que hay un cambio en la factura, esto trae dos problemas:
1. Es molesto para los usuarios que, luego de haber cargado las percepciones, quieren hacer una modificacion
y se les recomputa todo
Expand All @@ -231,7 +231,7 @@ def _recompute_tax_lines(self, recompute_tax_base_amount=False):
"""
# if calling with recompute_tax_base_amount then tax amounts are not changed and we can return super directly
if recompute_tax_base_amount:
return super()._recompute_tax_lines(recompute_tax_base_amount=recompute_tax_base_amount)
return super()._recompute_tax_lines(recompute_tax_base_amount=recompute_tax_base_amount, tax_rep_lines_to_recompute=tax_rep_lines_to_recompute)
in_draft_mode = self != self._origin
fixed_taxes_bu = {
line: {
Expand All @@ -240,7 +240,7 @@ def _recompute_tax_lines(self, recompute_tax_base_amount=False):
'credit': line.credit,
} for line in self.line_ids.filtered(lambda x: x.tax_repartition_line_id.tax_id.amount_type == 'fixed')}

res = super()._recompute_tax_lines(recompute_tax_base_amount=recompute_tax_base_amount)
res = super()._recompute_tax_lines(recompute_tax_base_amount=recompute_tax_base_amount, tax_rep_lines_to_recompute=tax_rep_lines_to_recompute)
for tax_line in self.line_ids.filtered(
lambda x: x.tax_repartition_line_id.tax_id.amount_type == 'fixed' and x in fixed_taxes_bu):
tax_line.update(fixed_taxes_bu.get(tax_line))
Expand Down

0 comments on commit 33ec23b

Please sign in to comment.