Allow to define options for workbook creation

This commit is contained in:
jcoux
2016-10-14 15:10:06 +02:00
parent a00bddf5dd
commit 5def80e4eb
2 changed files with 5 additions and 2 deletions

View File

@@ -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': [

View File

@@ -35,11 +35,14 @@ class ReportXlsx(report_sxw):
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()