Browse Source

mis_builder: fix typo, causes crash if report_xslx is missing (#195)

[FIX] mis_builder: crash if report_xslx is missing
pull/197/head
Leonardo Pistone 9 years ago
committed by Stéphane Bidoul (ACSONE)
parent
commit
eb5e4371cc
  1. 9
      mis_builder/report/mis_report_instance_xlsx.py

9
mis_builder/report/mis_report_instance_xlsx.py

@ -17,7 +17,8 @@ try:
except ImportError: except ImportError:
_logger.debug("report_xlsx not installed, Excel export non functional") _logger.debug("report_xlsx not installed, Excel export non functional")
class ReportXslx:
class ReportXlsx(object):
def __init__(self, *args, **kwargs):
pass pass
@ -27,11 +28,11 @@ MIN_COL_WIDTH = 10 # characters
MAX_COL_WIDTH = 50 # characters MAX_COL_WIDTH = 50 # characters
class MisBuilderXslx(ReportXlsx):
class MisBuilderXlsx(ReportXlsx):
def __init__(self, name, table, rml=False, parser=False, header=True, def __init__(self, name, table, rml=False, parser=False, header=True,
store=False): store=False):
super(MisBuilderXslx, self).__init__(
super(MisBuilderXlsx, self).__init__(
name, table, rml, parser, header, store) name, table, rml, parser, header, store)
def generate_xlsx_report(self, workbook, data, objects): def generate_xlsx_report(self, workbook, data, objects):
@ -136,5 +137,5 @@ class MisBuilderXslx(ReportXlsx):
sheet.set_column(min_col_pos, max_col_pos, data_col_width * COL_WIDTH) sheet.set_column(min_col_pos, max_col_pos, data_col_width * COL_WIDTH)
MisBuilderXslx('report.mis.report.instance.xlsx',
MisBuilderXlsx('report.mis.report.instance.xlsx',
'mis.report.instance', parser=report_sxw.rml_parse) 'mis.report.instance', parser=report_sxw.rml_parse)
Loading…
Cancel
Save