recalculate the accounting entry tax according to the value of the tax calculated on the invoice
on the invoice, on the seat line. I have a tax that according to the scenario I have to recalculate. the calculation of the tax in the invoice document is correct, but when the accounting entry is generated. even though the tax on the invoice is for example XXX, in the accounting entry ZZZ generates me (calculation by default of the tax). how can you do to recalculate the tax line in the accounting entry according to the value of the tax on the invoice.
for line in self.invoice_line_ids:
for line2 in line.invoice_line_tax_ids:
for index,line_tax in enumerate(line2):
if line_tax.tipo_afectacion_igv.code in ["10"]:
self.amount_tax += round_curr((line.price_subtotal+line.calculo_isc_items)*line_tax.amount/100*(1-self.descuento_global/100))