Browse Source

add proper titles

pull/489/head
Jordi Ballester Alomar 6 years ago
parent
commit
f4b6c88008
  1. 4
      account_financial_report/report/abstract_report_xlsx.py
  2. 6
      account_financial_report/report/aged_partner_balance_xlsx.py
  3. 6
      account_financial_report/report/general_ledger_xlsx.py
  4. 6
      account_financial_report/report/journal_ledger_xlsx.py
  5. 6
      account_financial_report/report/open_items_xlsx.py
  6. 9
      account_financial_report/report/templates/aged_partner_balance.xml
  7. 9
      account_financial_report/report/templates/general_ledger.xml
  8. 10
      account_financial_report/report/templates/journal_ledger.xml
  9. 10
      account_financial_report/report/templates/layouts.xml
  10. 10
      account_financial_report/report/templates/open_items.xml
  11. 8
      account_financial_report/report/templates/trial_balance.xml
  12. 4
      account_financial_report/report/templates/vat_report.xml
  13. 6
      account_financial_report/report/trial_balance_xlsx.py
  14. 6
      account_financial_report/report/vat_report_xlsx.py

4
account_financial_report/report/abstract_report_xlsx.py

@ -41,7 +41,7 @@ class AbstractReportXslx(models.AbstractModel):
self._define_formats(workbook)
report_name = self._get_report_name()
report_name = self._get_report_name(objects)
report_footer = self._get_report_footer()
filters = self._get_report_filters(report)
self.columns = self._get_report_columns(report)
@ -349,7 +349,7 @@ class AbstractReportXslx(models.AbstractModel):
"""
raise NotImplementedError()
def _get_report_name(self):
def _get_report_name(self, objects):
"""
Allow to define the report name.
Report name will be used as sheet name and as report title.

6
account_financial_report/report/aged_partner_balance_xlsx.py

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

6
account_financial_report/report/general_ledger_xlsx.py

@ -11,8 +11,10 @@ class GeneralLedgerXslx(models.AbstractModel):
_name = 'report.a_f_r.report_general_ledger_xlsx'
_inherit = 'report.account_financial_report.abstract_report_xlsx'
def _get_report_name(self):
return _('General Ledger')
def _get_report_name(self, objects):
report = objects
return _('General Ledger - %s - %s') % (
report.company_id.name, report.company_id.currency_id.name)
def _get_report_columns(self, report):
res = {

6
account_financial_report/report/journal_ledger_xlsx.py

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

6
account_financial_report/report/open_items_xlsx.py

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

9
account_financial_report/report/templates/aged_partner_balance.xml

@ -14,12 +14,13 @@
<template id="report_aged_partner_balance_base">
<!-- Saved flag fields into variables, used to define columns display -->
<t t-set="show_move_line_details" t-value="o.show_move_line_details"/>
<!-- Defines global variables used by internal layout -->
<t t-set="title">Aged Partner Balance</t>
<t t-set="title">Aged Partner Balance - <t t-raw="o.company_id.name"/> - <t t-raw="o.company_id.currency_id.name"/></t>
<t t-set="company_name" t-value="o.company_id.name"/>
<div class="page">
<div class="page data_table">
<div class="row">
<h4 class="mt0" t-esc="title or 'Odoo Report'"/>
</div>
<!-- Display filters -->
<t t-call="account_financial_report.report_aged_partner_balance_filters"/>

9
account_financial_report/report/templates/general_ledger.xml

@ -17,13 +17,14 @@
<t t-set="show_cost_center" t-value="o.show_cost_center"/>
<t t-set="foreign_currency" t-value="o.foreign_currency"/>
<!-- Defines global variables used by internal layout -->
<t t-set="title">General Ledger</t>
<t t-set="title">General Ledger - <t t-raw="o.company_id.name"/> - <t t-raw="o.company_id.currency_id.name"/></t>
<t t-set="company_name" t-value="o.company_id.name"/>
<div class="page">
<div class="page data_table">
<div class="row">
<h4 class="mt0" t-esc="title or 'Odoo Report'"/>
</div>
<!-- Display filters -->
<t t-call="account_financial_report.report_general_ledger_filters"/>
<t t-foreach="o.account_ids" t-as="account">
<div class="page_break">
<!-- Display account header -->

10
account_financial_report/report/templates/journal_ledger.xml

@ -12,12 +12,14 @@
</template>
<template id="report_journal_ledger_base">
<t t-set="title">Journal Ledger</t>
<t t-set="company_name" t-value="o.company_id.name"/>
<t t-set="display_currency" t-value="o.foreign_currency"/>
<t t-set="display_account_name" t-value="o.with_account_name"/>
<div class="page">
<t t-set="title">Journal Ledger - <t t-raw="o.company_id.name"/> - <t t-raw="o.company_id.currency_id.name"/></t>
<t t-set="company_name" t-value="o.company_id.name"/>
<div class="page data_table">
<div class="row">
<h4 class="mt0" t-esc="title or 'Odoo Report'"/>
</div>
<t t-if="o.group_option == 'none'">
<div class="page_break">
<t t-call="account_financial_report.report_journal_all"/>

10
account_financial_report/report/templates/layouts.xml

@ -2,16 +2,6 @@
<odoo>
<template id="account_financial_report.internal_layout">
<div class="header">
<div class="row">
<div class="col-xs-6">
<span t-esc="title"/>
</div>
<div class="col-xs-6 text-right">
<span t-esc="company_name"/>
</div>
</div>
</div>
<div class="article">
<link href="/account_financial_report/static/src/css/report.css" rel="stylesheet"/>
<t t-raw="0" />

10
account_financial_report/report/templates/open_items.xml

@ -14,13 +14,13 @@
<template id="account_financial_report.report_open_items_base">
<!-- Saved flag fields into variables, used to define columns display -->
<t t-set="foreign_currency" t-value="o.foreign_currency"/>
<!-- Defines global variables used by internal layout -->
<t t-set="title">Open Items</t>
<t t-set="title">Open Items - <t t-raw="o.company_id.name"/> - <t t-raw="o.company_id.currency_id.name"/></t>
<t t-set="company_name" t-value="o.company_id.name"/>
<div class="page">
<div class="page data_table">
<div class="row">
<h4 class="mt0" t-esc="title or 'Odoo Report'"/>
</div>
<!-- Display filters -->
<t t-call="account_financial_report.report_open_items_filters"/>

8
account_financial_report/report/templates/trial_balance.xml

@ -16,11 +16,13 @@
<t t-set="show_partner_details" t-value="o.show_partner_details"/>
<t t-set="foreign_currency" t-value="o.foreign_currency"/>
<!-- Defines global variables used by internal layout -->
<t t-set="title">Trial Balance</t>
<t t-set="title">Trial Balance - <t t-raw="o.company_id.name"/> - <t t-raw="o.company_id.currency_id.name"/></t>
<t t-set="company_name" t-value="o.company_id.name"/>
<t t-set="res_company" t-value="o.company_id"/>
<div class="page">
<div class="page data_table">
<div class="row">
<h4 class="mt0" t-esc="title or 'Odoo Report'"/>
</div>
<!-- Display filters -->
<t t-call="account_financial_report.report_trial_balance_filters"/>
<div class="act_as_table list_table" style="margin-top: 10px;"/>

4
account_financial_report/report/templates/vat_report.xml

@ -12,15 +12,15 @@
</template>
<template id="account_financial_report.report_vat_report_base">
<t t-set="title">VAT Report - <t t-raw="o.company_id.name"/> - <t t-raw="o.company_id.currency_id.name"/></t>
<t t-set="company_name" t-value="o.company_id.name"/>
<div class="page data_table">
<t t-set="title">VAT Report</t>
<div class="row">
<h4 class="mt0" t-esc="title or 'Odoo Report'"/>
</div>
<!-- Display filters -->
<t t-call="account_financial_report.report_vat_report_filters"/>
<div class="page_break"/>
<div class="act_as_table data_table" style="width: 100%;">
<!-- Display table headers for lines -->
<div class="act_as_thead">

6
account_financial_report/report/trial_balance_xlsx.py

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

6
account_financial_report/report/vat_report_xlsx.py

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

Loading…
Cancel
Save