From 1fcc65adfb3020cb95b6715fb8fe63dc3f3595f6 Mon Sep 17 00:00:00 2001 From: Jordi Ballester Alomar Date: Thu, 10 Jan 2019 19:32:40 +0100 Subject: [PATCH] [account_financial_report_qweb] fix title formatting for all reports --- account_financial_report_qweb/__manifest__.py | 2 +- .../report/abstract_report_xlsx.py | 7 +++++++ .../report/aged_partner_balance_xlsx.py | 4 ++-- .../report/general_ledger_xlsx.py | 4 ++-- .../report/journal_report_xlsx.py | 4 ++-- account_financial_report_qweb/report/open_items_xlsx.py | 4 ++-- account_financial_report_qweb/report/trial_balance_xlsx.py | 4 ++-- 7 files changed, 18 insertions(+), 11 deletions(-) diff --git a/account_financial_report_qweb/__manifest__.py b/account_financial_report_qweb/__manifest__.py index 8eaaa8a2..6df46772 100644 --- a/account_financial_report_qweb/__manifest__.py +++ b/account_financial_report_qweb/__manifest__.py @@ -5,7 +5,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'QWeb Financial Reports', - 'version': '10.0.3.0.0', + 'version': '10.0.3.0.1', 'category': 'Reporting', 'summary': 'OCA Financial Reports', 'author': 'Camptocamp SA,' diff --git a/account_financial_report_qweb/report/abstract_report_xlsx.py b/account_financial_report_qweb/report/abstract_report_xlsx.py index fceb68f1..d3f8d21d 100644 --- a/account_financial_report_qweb/report/abstract_report_xlsx.py +++ b/account_financial_report_qweb/report/abstract_report_xlsx.py @@ -360,6 +360,13 @@ class AbstractReportXslx(ReportXlsx): def _generate_report_content(self, workbook, report): pass + def _get_report_complete_name(self, report, prefix): + if report.company_id: + suffix = ' - %s - %s' % ( + report.company_id.name, report.company_id.currency_id.name) + return prefix + suffix + return prefix + def _get_report_name(self, objects): """ Allow to define the report name. diff --git a/account_financial_report_qweb/report/aged_partner_balance_xlsx.py b/account_financial_report_qweb/report/aged_partner_balance_xlsx.py index 7200962c..afce7a4f 100644 --- a/account_financial_report_qweb/report/aged_partner_balance_xlsx.py +++ b/account_financial_report_qweb/report/aged_partner_balance_xlsx.py @@ -16,8 +16,8 @@ class AgedPartnerBalanceXslx(abstract_report_xlsx.AbstractReportXslx): name, table, rml, parser, header, store) def _get_report_name(self, report): - return _('Aged Partner Balance - %s - %s') % ( - report.company_id.name, report.company_id.currency_id.name) + report_name = _('Aged Partner Balance') + return self._get_report_complete_name(report, report_name) def _get_report_columns(self, report): if not report.show_move_line_details: diff --git a/account_financial_report_qweb/report/general_ledger_xlsx.py b/account_financial_report_qweb/report/general_ledger_xlsx.py index 5e68d83d..d7698f71 100644 --- a/account_financial_report_qweb/report/general_ledger_xlsx.py +++ b/account_financial_report_qweb/report/general_ledger_xlsx.py @@ -17,8 +17,8 @@ class GeneralLedgerXslx(abstract_report_xlsx.AbstractReportXslx): name, table, rml, parser, header, store) def _get_report_name(self, report): - return _('General Ledger - %s - %s') % ( - report.company_id.name, report.company_id.currency_id.name) + report_name = _('General Ledger') + return self._get_report_complete_name(report, report_name) def _get_report_columns(self, report): res = { diff --git a/account_financial_report_qweb/report/journal_report_xlsx.py b/account_financial_report_qweb/report/journal_report_xlsx.py index 7b838f5f..9bb19cf7 100644 --- a/account_financial_report_qweb/report/journal_report_xlsx.py +++ b/account_financial_report_qweb/report/journal_report_xlsx.py @@ -18,8 +18,8 @@ class JournalXslx(abstract_report_xlsx.AbstractReportXslx): name, table, rml, parser, header, store) def _get_report_name(self, report): - return _('Journal Ledger - %s - %s') % ( - report.company_id.name, report.company_id.currency_id.name) + report_name = _('Journal Ledger') + return self._get_report_complete_name(report, report_name) def _get_report_columns(self, report): columns = [ diff --git a/account_financial_report_qweb/report/open_items_xlsx.py b/account_financial_report_qweb/report/open_items_xlsx.py index 566b4e78..58343068 100644 --- a/account_financial_report_qweb/report/open_items_xlsx.py +++ b/account_financial_report_qweb/report/open_items_xlsx.py @@ -16,8 +16,8 @@ class OpenItemsXslx(abstract_report_xlsx.AbstractReportXslx): name, table, rml, parser, header, store) def _get_report_name(self, report): - return _('Open Items - %s - %s') % ( - report.company_id.name, report.company_id.currency_id.name) + report_name = _('Open Items') + return self._get_report_complete_name(report, report_name) def _get_report_columns(self, report): res = { diff --git a/account_financial_report_qweb/report/trial_balance_xlsx.py b/account_financial_report_qweb/report/trial_balance_xlsx.py index 7419df49..b874b688 100644 --- a/account_financial_report_qweb/report/trial_balance_xlsx.py +++ b/account_financial_report_qweb/report/trial_balance_xlsx.py @@ -16,8 +16,8 @@ class TrialBalanceXslx(abstract_report_xlsx.AbstractReportXslx): name, table, rml, parser, header, store) def _get_report_name(self, report): - return _('Trial Balance - %s - %s') % ( - report.company_id.name, report.company_id.currency_id.name) + report_name = _('Trial Balance') + return self._get_report_complete_name(report, report_name) def _get_report_columns(self, report): if not report.show_partner_details: