From ad345e081bbe23ac9f767110dcbcb9889faaed05 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Mon, 8 Mar 2021 15:10:10 +0000 Subject: [PATCH] [REF] l10n_it_edi: allow to pass extra values to render the template We need this refactor for the ddt module to be able to pass the necessary information easily for the link between the invoice lines and the ddts. X-original-commit: a4fb5c93f094dc1cd4de75664b7e232bc505e05c --- addons/l10n_it_edi/models/account_invoice.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/l10n_it_edi/models/account_invoice.py b/addons/l10n_it_edi/models/account_invoice.py index da3098852ab..a88e5d1badd 100644 --- a/addons/l10n_it_edi/models/account_invoice.py +++ b/addons/l10n_it_edi/models/account_invoice.py @@ -154,7 +154,7 @@ class AccountMove(models.Model): ) return {'attachment': attachment} - def _export_as_xml(self): + def _prepare_fatturapa_export_values(self): ''' Create the xml file content. :return: The XML content as str. ''' @@ -249,6 +249,10 @@ class AccountMove(models.Model): 'pdf_name': pdf_name, 'tax_map': tax_map, } + return template_values + + def _export_as_xml(self): + template_values = self._prepare_fatturapa_export_values() content = self.env.ref('l10n_it_edi.account_invoice_it_FatturaPA_export')._render(template_values) return content