mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[10.0] report_xlsx: Allow to define options for workbook creation (#98)
* Allow to define options for workbook creation
This commit is contained in:
committed by
Alex Cuellar
parent
df8d887011
commit
bed10964e6
@@ -10,7 +10,7 @@
|
|||||||
'Odoo Community Association (OCA)',
|
'Odoo Community Association (OCA)',
|
||||||
'website': "http://acsone.eu",
|
'website': "http://acsone.eu",
|
||||||
'category': 'Reporting',
|
'category': 'Reporting',
|
||||||
'version': '10.0.1.0.0',
|
'version': '10.0.1.0.1',
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
'external_dependencies': {'python': ['xlsxwriter']},
|
'external_dependencies': {'python': ['xlsxwriter']},
|
||||||
'depends': [
|
'depends': [
|
||||||
|
|||||||
@@ -35,11 +35,14 @@ class ReportXlsx(report_sxw):
|
|||||||
self.env.cr, self.env.uid, ids, self.env.context)
|
self.env.cr, self.env.uid, ids, self.env.context)
|
||||||
self.parser_instance.set_context(objs, data, ids, 'xlsx')
|
self.parser_instance.set_context(objs, data, ids, 'xlsx')
|
||||||
file_data = StringIO()
|
file_data = StringIO()
|
||||||
workbook = xlsxwriter.Workbook(file_data)
|
workbook = xlsxwriter.Workbook(file_data, self.get_workbook_options())
|
||||||
self.generate_xlsx_report(workbook, data, objs)
|
self.generate_xlsx_report(workbook, data, objs)
|
||||||
workbook.close()
|
workbook.close()
|
||||||
file_data.seek(0)
|
file_data.seek(0)
|
||||||
return (file_data.read(), 'xlsx')
|
return (file_data.read(), 'xlsx')
|
||||||
|
|
||||||
|
def get_workbook_options(self):
|
||||||
|
return {}
|
||||||
|
|
||||||
def generate_xlsx_report(self, workbook, data, objs):
|
def generate_xlsx_report(self, workbook, data, objs):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|||||||
Reference in New Issue
Block a user