Browse Source

Merge pull request #68 from OCA/8.0-report_xlsx-readme-fix

[FIX] report_xlsx: Protect import + CamelCase class
pull/70/head
Pedro M. Baeza 8 years ago
committed by GitHub
parent
commit
26bf6ef222
  1. 12
      report_xlsx/README.rst

12
report_xlsx/README.rst

@ -22,9 +22,14 @@ An example of XLSX report for partners:
A python class ::
from openerp.addons.report_xlsx.report.report_xlsx import ReportXlsx
try:
from openerp.addons.report_xlsx.report.report_xlsx import ReportXlsx
except ImportError:
class ReportXlsx(object):
def __init__(self, *args, **kwargs):
pass
class partner_xlsx(ReportXlsx):
class PartnerXlsx(ReportXlsx):
def generate_xlsx_report(self, workbook, data, partners):
for obj in partners:
@ -35,8 +40,7 @@ A python class ::
sheet.write(0, 0, obj.name, bold)
partner_xlsx('report.res.partner.xlsx',
'res.partner')
PartnerXlsx('report.res.partner.xlsx', 'res.partner')
To manipulate the ``workbook`` and ``sheet`` objects, refer to the
`documentation <http://xlsxwriter.readthedocs.org/>`_ of ``xlsxwriter``.

Loading…
Cancel
Save