Skip to content

Commit

Permalink
Merge pull request #77 from jcoux/add_options_on_workbook_creation
Browse files Browse the repository at this point in the history
Allow to define options for workbook creation
  • Loading branch information
pedrobaeza authored Oct 14, 2016
2 parents a00bddf + 5def80e commit 8fd7b80
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion report_xlsx/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
'Odoo Community Association (OCA)',
'website': "http://acsone.eu",
'category': 'Reporting',
'version': '9.0.1.0.0',
'version': '9.0.1.0.1',
'license': 'AGPL-3',
'external_dependencies': {'python': ['xlsxwriter']},
'depends': [
Expand Down
5 changes: 4 additions & 1 deletion report_xlsx/report/report_xlsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,14 @@ def create_xlsx_report(self, ids, data, report):
self.env.cr, self.env.uid, ids, self.env.context)
self.parser_instance.set_context(objs, data, ids, 'xlsx')
file_data = StringIO()
workbook = xlsxwriter.Workbook(file_data)
workbook = xlsxwriter.Workbook(file_data, self.get_workbook_options())
self.generate_xlsx_report(workbook, data, objs)
workbook.close()
file_data.seek(0)
return (file_data.read(), 'xlsx')

def get_workbook_options(self):
return {}

def generate_xlsx_report(self, workbook, data, objs):
raise NotImplementedError()

0 comments on commit 8fd7b80

Please sign in to comment.