diff --git a/addons/l10n_ke_edi_tremol/models/account_move.py b/addons/l10n_ke_edi_tremol/models/account_move.py index 376aab3327a..0d65b08b115 100644 --- a/addons/l10n_ke_edi_tremol/models/account_move.py +++ b/addons/l10n_ke_edi_tremol/models/account_move.py @@ -164,15 +164,15 @@ class AccountMove(models.Model): break msgs = [] - tax_details = self._prepare_edi_tax_details() + tax_details = self._prepare_invoice_aggregated_taxes() for line in self.invoice_line_ids.filtered(lambda l: l.display_type == 'product' and l.quantity and l.price_total > 0 and not discount_dict.get(l.id) >= 100): # Here we use the original discount of the line, since it the distributed discount has not been applied in the price_total price_total = 0 percentage = 0 item_code = line.tax_ids[0].l10n_ke_item_code_id - for tax in tax_details['invoice_line_tax_details'][line]['tax_details']: + for tax in tax_details['tax_details_per_record'][line]['tax_details']: if tax['tax'].amount in (16, 8, 0): # This should only occur once - tax_details = tax_details['invoice_line_tax_details'][line]['tax_details'][tax] + tax_details = tax_details['tax_details_per_record'][line]['tax_details'][tax] price_total = abs(tax_details['base_amount_currency']) + abs(tax_details['tax_amount_currency']) percentage = tax['tax'].amount price = round(price_total / abs(line.quantity) * 100 / (100 - line.discount), 2) * currency_rate