Skip to content

Commit

Permalink
[10.0] report_xlsx: Allow to define options for workbook creation (#98)
Browse files Browse the repository at this point in the history
* Allow to define options for workbook creation
  • Loading branch information
sbidoul authored and StefanRijnhart committed Feb 22, 2017
1 parent bd1455a commit 204afa0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion report_xlsx/__manifest__.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': '10.0.1.0.0',
'version': '10.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 204afa0

Please sign in to comment.