[account_financial_report] fix title formatting for all reports

pull/939/head
Jordi Ballester Alomar 2019-01-10 19:11:24 +01:00 committed by David Ramia
parent 5396ef00d1
commit 7ec38fbf6d
8 changed files with 20 additions and 13 deletions

View File

@ -4,7 +4,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{ {
'name': 'Account Financial Reports', 'name': 'Account Financial Reports',
'version': '11.0.2.4.1', 'version': '11.0.2.4.2',
'category': 'Reporting', 'category': 'Reporting',
'summary': 'OCA Financial Reports', 'summary': 'OCA Financial Reports',
'author': 'Camptocamp SA,' 'author': 'Camptocamp SA,'

View File

@ -349,6 +349,13 @@ class AbstractReportXslx(models.AbstractModel):
""" """
raise NotImplementedError() raise NotImplementedError()
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, report): def _get_report_name(self, report):
""" """
Allow to define the report name. Allow to define the report name.

View File

@ -11,8 +11,8 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
_inherit = 'report.account_financial_report.abstract_report_xlsx' _inherit = 'report.account_financial_report.abstract_report_xlsx'
def _get_report_name(self, report): def _get_report_name(self, report):
return _('Aged Partner Balance - %s - %s') % ( report_name = _('Aged Partner Balance')
report.company_id.name, report.company_id.currency_id.name) return self._get_report_complete_name(report, report_name)
def _get_report_columns(self, report): def _get_report_columns(self, report):
if not report.show_move_line_details: if not report.show_move_line_details:

View File

@ -12,8 +12,8 @@ class GeneralLedgerXslx(models.AbstractModel):
_inherit = 'report.account_financial_report.abstract_report_xlsx' _inherit = 'report.account_financial_report.abstract_report_xlsx'
def _get_report_name(self, report): def _get_report_name(self, report):
return _('General Ledger - %s - %s') % ( report_name = _('General Ledger')
report.company_id.name, report.company_id.currency_id.name) return self._get_report_complete_name(report, report_name)
def _get_report_columns(self, report): def _get_report_columns(self, report):
res = { res = {

View File

@ -11,8 +11,8 @@ class JournalLedgerXslx(models.AbstractModel):
_inherit = 'report.account_financial_report.abstract_report_xlsx' _inherit = 'report.account_financial_report.abstract_report_xlsx'
def _get_report_name(self, report): def _get_report_name(self, report):
return _('Journal Ledger - %s - %s') % ( report_name = _('Journal Ledger')
report.company_id.name, report.company_id.currency_id.name) return self._get_report_complete_name(report, report_name)
def _get_report_columns(self, report): def _get_report_columns(self, report):
columns = [ columns = [

View File

@ -10,8 +10,8 @@ class OpenItemsXslx(models.AbstractModel):
_inherit = 'report.account_financial_report.abstract_report_xlsx' _inherit = 'report.account_financial_report.abstract_report_xlsx'
def _get_report_name(self, report): def _get_report_name(self, report):
return _('Open Items - %s - %s') % ( report_name = _('Open Items')
report.company_id.name, report.company_id.currency_id.name) return self._get_report_complete_name(report, report_name)
def _get_report_columns(self, report): def _get_report_columns(self, report):
res = { res = {

View File

@ -11,8 +11,8 @@ class TrialBalanceXslx(models.AbstractModel):
_inherit = 'report.account_financial_report.abstract_report_xlsx' _inherit = 'report.account_financial_report.abstract_report_xlsx'
def _get_report_name(self, report): def _get_report_name(self, report):
return _('Trial Balance - %s - %s') % ( report_name = _('Trial Balance')
report.company_id.name, report.company_id.currency_id.name) return self._get_report_complete_name(report, report_name)
def _get_report_columns(self, report): def _get_report_columns(self, report):
if not report.show_partner_details: if not report.show_partner_details:

View File

@ -9,8 +9,8 @@ class VATReportXslx(models.AbstractModel):
_inherit = 'report.account_financial_report.abstract_report_xlsx' _inherit = 'report.account_financial_report.abstract_report_xlsx'
def _get_report_name(self, report): def _get_report_name(self, report):
return _('VAT Report - %s - %s') % ( report_name = _('VAT Report')
report.company_id.name, report.company_id.currency_id.name) return self._get_report_complete_name(report, report_name)
def _get_report_columns(self, report): def _get_report_columns(self, report):
return { return {