From 8d09615777ded8cac4cc0082e00ce4c2e9f68daa Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Thu, 15 Dec 2022 01:58:26 -0300 Subject: [PATCH] [IMP] l10n_br_fiscal: add event print feature --- l10n_br_fiscal/__manifest__.py | 3 + l10n_br_fiscal/models/document_event.py | 5 + .../views/document_event_report.xml | 17 +++ .../views/document_event_template.xml | 116 ++++++++++++++++++ l10n_br_fiscal/views/document_view.xml | 5 + 5 files changed, 146 insertions(+) create mode 100644 l10n_br_fiscal/views/document_event_report.xml create mode 100644 l10n_br_fiscal/views/document_event_template.xml diff --git a/l10n_br_fiscal/__manifest__.py b/l10n_br_fiscal/__manifest__.py index 55a372692c46..05a3f29dcaae 100644 --- a/l10n_br_fiscal/__manifest__.py +++ b/l10n_br_fiscal/__manifest__.py @@ -88,6 +88,9 @@ # "views/dfe/dfe_views.xml", "views/operation_dashboard_view.xml", "views/document_event_view.xml", + # Reports + "views/document_event_report.xml", + "views/document_event_template.xml", # Wizards "wizards/document_cancel_wizard.xml", "wizards/document_correction_wizard.xml", diff --git a/l10n_br_fiscal/models/document_event.py b/l10n_br_fiscal/models/document_event.py index 477b35fe04bd..2d37955a2181 100644 --- a/l10n_br_fiscal/models/document_event.py +++ b/l10n_br_fiscal/models/document_event.py @@ -377,3 +377,8 @@ def create_event_save_xml( event_id = self.create(vals) event_id._save_event_file(xml_file, "xml") return event_id + + def print_document_event(self): + return self.env.ref( + "l10n_br_fiscal.action_report_document_event" + ).report_action(self) diff --git a/l10n_br_fiscal/views/document_event_report.xml b/l10n_br_fiscal/views/document_event_report.xml new file mode 100644 index 000000000000..46303f0ca980 --- /dev/null +++ b/l10n_br_fiscal/views/document_event_report.xml @@ -0,0 +1,17 @@ + + + + + Document Event + l10n_br_fiscal.event + qweb-pdf + l10n_br_fiscal.main_report_document_event + l10n_br_fiscal.report_document_event + dict(object.fields_get(allfields=['type'])['type']['selection'])[object.type] + + report + + + diff --git a/l10n_br_fiscal/views/document_event_template.xml b/l10n_br_fiscal/views/document_event_template.xml new file mode 100644 index 000000000000..7ecbd0b50bf2 --- /dev/null +++ b/l10n_br_fiscal/views/document_event_template.xml @@ -0,0 +1,116 @@ + + + + + + + + + diff --git a/l10n_br_fiscal/views/document_view.xml b/l10n_br_fiscal/views/document_view.xml index da262bf2cd5d..b28a4f7835e8 100644 --- a/l10n_br_fiscal/views/document_view.xml +++ b/l10n_br_fiscal/views/document_view.xml @@ -415,6 +415,11 @@ +