|
@ -44,7 +44,7 @@ class AttrDict(dict): |
|
|
self.__dict__ = self |
|
|
self.__dict__ = self |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ReportXls(report_sxw): |
|
|
|
|
|
|
|
|
class report_xls(report_sxw): |
|
|
|
|
|
|
|
|
xls_types = { |
|
|
xls_types = { |
|
|
'bool': xlwt.Row.set_cell_boolean, |
|
|
'bool': xlwt.Row.set_cell_boolean, |
|
@ -112,7 +112,7 @@ class ReportXls(report_sxw): |
|
|
# use model from 'data' when no ir.actions.report.xml entry |
|
|
# use model from 'data' when no ir.actions.report.xml entry |
|
|
self.table = data.get('model') or self.table |
|
|
self.table = data.get('model') or self.table |
|
|
return self.create_source_xls(cr, uid, ids, data, context) |
|
|
return self.create_source_xls(cr, uid, ids, data, context) |
|
|
return super(ReportXls, self).create(cr, uid, ids, data, context) |
|
|
|
|
|
|
|
|
return super(report_xls, self).create(cr, uid, ids, data, context) |
|
|
|
|
|
|
|
|
def create_source_xls(self, cr, uid, ids, data, context=None): |
|
|
def create_source_xls(self, cr, uid, ids, data, context=None): |
|
|
if not context: |
|
|
if not context: |
|
@ -206,7 +206,7 @@ class ReportXls(report_sxw): |
|
|
c.append({'formula': s[5]}) |
|
|
c.append({'formula': s[5]}) |
|
|
else: |
|
|
else: |
|
|
c.append({ |
|
|
c.append({ |
|
|
'write_cell_func': ReportXls.xls_types[c[3]]}) |
|
|
|
|
|
|
|
|
'write_cell_func': report_xls.xls_types[c[3]]}) |
|
|
# Set custom cell style |
|
|
# Set custom cell style |
|
|
if s_len > 6 and s[6] is not None: |
|
|
if s_len > 6 and s[6] is not None: |
|
|
c.append(s[6]) |
|
|
c.append(s[6]) |
|
@ -221,7 +221,7 @@ class ReportXls(report_sxw): |
|
|
col += c[1] |
|
|
col += c[1] |
|
|
break |
|
|
break |
|
|
if not found: |
|
|
if not found: |
|
|
_logger.warn("ReportXls.xls_row_template, " |
|
|
|
|
|
|
|
|
_logger.warn("report_xls.xls_row_template, " |
|
|
"column '%s' not found in specs", w) |
|
|
"column '%s' not found in specs", w) |
|
|
return r |
|
|
return r |
|
|
|
|
|
|
|
@ -235,7 +235,7 @@ class ReportXls(report_sxw): |
|
|
style = spec[6] and spec[6] or row_style |
|
|
style = spec[6] and spec[6] or row_style |
|
|
if not data: |
|
|
if not data: |
|
|
# if no data, use default values |
|
|
# if no data, use default values |
|
|
data = ReportXls.xls_types_default[spec[3]] |
|
|
|
|
|
|
|
|
data = report_xls.xls_types_default[spec[3]] |
|
|
if size != 1: |
|
|
if size != 1: |
|
|
if formula: |
|
|
if formula: |
|
|
ws.write_merge( |
|
|
ws.write_merge( |
|
|