Skip to content

Commit

Permalink
[FIX] account_invoice_tax_amount: use display_type product
Browse files Browse the repository at this point in the history
  • Loading branch information
jjscarafia committed Oct 3, 2023
1 parent 047e3db commit c37d4c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions account_invoice_tax/wizards/account_invoice_tax.py
Expand Up @@ -81,7 +81,7 @@ def add_tax(self):
container = {'records': move}
with move.with_context(check_move_validity=False)._check_balanced(container):
with move._sync_dynamic_lines(container):
move.invoice_line_ids.filtered(lambda x: x.display_type not in ['line_section', 'line_note', 'payment_term']).write({'tax_ids': [Command.link(self.tax_id.id)]})
move.invoice_line_ids.filtered(lambda x: x.display_type == 'product').write({'tax_ids': [Command.link(self.tax_id.id)]})

# set amount in the new created tax line. En este momento si queda balanceado y se ajusta la linea AP/AR
container = {'records': move}
Expand Down Expand Up @@ -109,7 +109,7 @@ def remove_tax(self):
container = {'records': move_id, 'self': move_id}
with move_id._check_balanced(container):
with move_id._sync_dynamic_lines(container):
move_id.invoice_line_ids.write({'tax_ids': [Command.unlink(self.tax_id.id)]})
move_id.invoice_line_ids.filtered(lambda x: x.display_type == 'product').write({'tax_ids': [Command.unlink(self.tax_id.id)]})
for tax_line in move_id.line_ids.filtered(
lambda x: x.tax_repartition_line_id.tax_id in fixed_taxes_bu and x.tax_repartition_line_id.tax_id.amount_type == 'fixed'):
tax_line.write(fixed_taxes_bu.get(tax_line.tax_line_id))
Expand Down

0 comments on commit c37d4c2

Please sign in to comment.