From 4e253f1ffaef44549fd7e2d51e35fa91bd23e584 Mon Sep 17 00:00:00 2001 From: eLBati Date: Tue, 16 Mar 2021 11:18:04 +0100 Subject: [PATCH] IMP l10n_it_fatturapa_in adding "Recompute XML fields" button when fields like "invoices_number" and "registered" are not valorized This may happen in case of temporary errors while importing from SDI --- l10n_it_fatturapa_in/models/attachment.py | 4 ++++ l10n_it_fatturapa_in/views/account_view.xml | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/l10n_it_fatturapa_in/models/attachment.py b/l10n_it_fatturapa_in/models/attachment.py index ad4710e33825..8ae1d7607301 100644 --- a/l10n_it_fatturapa_in/models/attachment.py +++ b/l10n_it_fatturapa_in/models/attachment.py @@ -83,6 +83,10 @@ def _compute_e_invoice_validation_error(self): def get_xml_string(self): return self.ir_attachment_id.get_xml_string() + def recompute_xml_fields(self): + self._compute_xml_data() + self._compute_registered() + @api.depends("ir_attachment_id.datas") def _compute_xml_data(self): for att in self: diff --git a/l10n_it_fatturapa_in/views/account_view.xml b/l10n_it_fatturapa_in/views/account_view.xml index 2f1cff695aa8..95f28157b48c 100644 --- a/l10n_it_fatturapa_in/views/account_view.xml +++ b/l10n_it_fatturapa_in/views/account_view.xml @@ -31,6 +31,13 @@ text="Show preview" attrs="{'invisible': [('id', '=', False)]}" /> +