Skip to content

Commit

Permalink
[14.0][FIX] l10n_it_withholding_tax dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiocorato committed Jul 4, 2024
1 parent 55e4c1c commit 1a745c1
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions l10n_it_withholding_tax/models/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,20 +257,21 @@ def default_get(self, fields):
rec["amount"] = invoice["amount_net_pay_residual"] * coeff_net
return rec

def _compute_payment_amount(self, invoices=None, currency=None):
if not invoices:
invoices = self.invoice_ids
original_values = {}
for invoice in invoices:
if invoice.withholding_tax:
original_values[invoice] = invoice.residual_signed
invoice.residual_signed = invoice.amount_net_pay_residual
res = super(AccountAbstractPayment, self)._compute_payment_amount(
invoices, currency
)
for invoice in original_values:
invoice.residual_signed = original_values[invoice]
return res
# def _compute_payment_amount(self, invoices=None, currency=None):
# # DEAD CODE
# if not invoices:
# invoices = self.invoice_ids
# original_values = {}
# for invoice in invoices:
# if invoice.withholding_tax:
# original_values[invoice] = invoice.residual_signed
# invoice.residual_signed = invoice.amount_net_pay_residual
# res = super(AccountAbstractPayment, self)._compute_payment_amount(
# invoices, currency
# )
# for invoice in original_values:
# invoice.residual_signed = original_values[invoice]
# return res


class AccountFiscalPosition(models.Model):
Expand Down

0 comments on commit 1a745c1

Please sign in to comment.