From a0653089fe4639955b0ca866fae2d4051d9dbcc1 Mon Sep 17 00:00:00 2001 From: Katherine Zaoral Date: Wed, 22 Jul 2020 15:26:21 +0000 Subject: [PATCH] [REF] l10n_cl: Add custom report Port foward from 13.0 branch . Also adapt _get_name_invoice_report() method to match the new method in account. --- addons/l10n_cl/__manifest__.py | 1 + addons/l10n_cl/models/account_move.py | 6 ++++ addons/l10n_cl/views/report_invoice.xml | 39 +++++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 addons/l10n_cl/views/report_invoice.xml diff --git a/addons/l10n_cl/__manifest__.py b/addons/l10n_cl/__manifest__.py index f562cb70c43..f1941906f24 100644 --- a/addons/l10n_cl/__manifest__.py +++ b/addons/l10n_cl/__manifest__.py @@ -25,6 +25,7 @@ Plan contable chileno e impuestos de acuerdo a disposiciones vigentes 'views/ir_sequence_view.xml', 'views/res_bank_view.xml', 'views/res_country_view.xml', + 'views/report_invoice.xml', 'views/res_partner.xml', 'views/res_config_settings_view.xml', 'data/l10n_cl_chart_data.xml', diff --git a/addons/l10n_cl/models/account_move.py b/addons/l10n_cl/models/account_move.py index 605a2cf0a34..69b170502e9 100644 --- a/addons/l10n_cl/models/account_move.py +++ b/addons/l10n_cl/models/account_move.py @@ -114,3 +114,9 @@ class AccountMove(models.Model): where_string += " AND l10n_latam_document_type_id = %(l10n_latam_document_type_id)s " param['l10n_latam_document_type_id'] = self.l10n_latam_document_type_id.id or 0 return where_string, param + + def _get_name_invoice_report(self): + self.ensure_one() + if self.l10n_latam_use_documents and self.company_id.country_id.code == 'CL': + return 'l10n_cl.report_invoice_document' + return super()._get_name_invoice_report() diff --git a/addons/l10n_cl/views/report_invoice.xml b/addons/l10n_cl/views/report_invoice.xml new file mode 100644 index 00000000000..0b72ba453d7 --- /dev/null +++ b/addons/l10n_cl/views/report_invoice.xml @@ -0,0 +1,39 @@ + + + + + +