Skip to content

Commit

Permalink
[FIX] report_xlsx: Protect import + CamelCase class
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrobaeza committed Aug 17, 2016
1 parent 21d65b4 commit 6ce9af8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions report_xlsx/README.rst
Expand Up @@ -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:
Expand All @@ -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``.
Expand Down

0 comments on commit 6ce9af8

Please sign in to comment.