From fa7cb988e2d533b62e0f2bd8cdfbdfca3e1ef5b5 Mon Sep 17 00:00:00 2001 From: dbkosky Date: Mon, 1 Aug 2022 14:37:40 +0000 Subject: [PATCH] [FIX] l10n_it_edi: negative template values for reverse charge refunds When issuing a refund for a reverse charge bill, the document type should be the same as the parent bill type (either TD16, TD17 or TD18, rather than TD04), and the values of the lines and totals should be negative. To fix this the values are made negative dependent upon whether the invoice is a 'rc_refund' as in a "reverse charge refund". The way that the document type is ascertained is also changed in order to include the 'in_refund' (for the case of the reverse charge refund). The way document_total (ImportoTotaleDocumento) has been made conditionally negative in the case when the invoice is a reverse charge refund. A test has been added for the reverse charge refund case, and the test taxes have been adapted so that the correct tags are being used (and so that tags are used on the refund lines). closes odoo/odoo#97619 Ticket-id: 2936967 X-original-commit: ca2f4c8e1babe9444bc2c6a7421eafb63f1c9346 Signed-off-by: Josse Colpaert Signed-off-by: Daniel Kosky (dako) --- .../l10n_it_edi/data/invoice_it_template.xml | 20 ++++++-- .../l10n_it_edi/models/account_edi_format.py | 18 ++++---- addons/l10n_it_edi/models/account_invoice.py | 10 +++- .../tests/test_edi_reverse_charge_xml.py | 46 ++++++++++++++++--- 4 files changed, 72 insertions(+), 22 deletions(-) diff --git a/addons/l10n_it_edi/data/invoice_it_template.xml b/addons/l10n_it_edi/data/invoice_it_template.xml index 1c3405970e2..1eb9cd1204d 100644 --- a/addons/l10n_it_edi/data/invoice_it_template.xml +++ b/addons/l10n_it_edi/data/invoice_it_template.xml @@ -3,6 +3,12 @@