Browse Source

[IMP] mis_builder: more lint

pull/189/head
Stéphane Bidoul 9 years ago
parent
commit
022b8a8998
  1. 2
      mis_builder/report/mis_report_instance_xlsx.py
  2. 21
      mis_builder/tests/test_mis_report_instance.py

2
mis_builder/report/mis_report_instance_xlsx.py

@ -122,8 +122,6 @@ class MisBuilderXslx(ReportXlsx):
elif cell.val is None or cell.val is AccountingNone:
val = ''
else:
_logger.info("*** %s %s %s", cell.row.label,
cell.subcol.label, cell.val)
val = cell.val / float(cell.style_props.get('divider', 1))
sheet.write(row_pos, col_pos, val, cell_format)
col_width[col_pos] = max(col_width[col_pos],

21
mis_builder/tests/test_mis_report_instance.py

@ -32,16 +32,14 @@ class TestMisReportInstance(common.TransactionCase):
name='sk2',
description='subkpi 2',
sequence=2,
)),
],
))],
query_ids=[(0, 0, dict(
name='partner',
model_id=partner_model_id,
field_ids=[(4, partner_debit_field_id, None)],
date_field=partner_create_date_field_id,
aggregate='sum',
)),
],
))],
))
# kpi with accounting formulas
self.env['mis.report.kpi'].create(dict(
@ -55,8 +53,7 @@ class TestMisReportInstance(common.TransactionCase):
)), (0, 0, dict(
name='balp[200%]',
subkpi_id=self.report.subkpi_ids[1].id,
)),
],
))],
))
# kpi with accounting formula and query
self.env['mis.report.kpi'].create(dict(
@ -70,8 +67,7 @@ class TestMisReportInstance(common.TransactionCase):
)), (0, 0, dict(
name='partner.debit',
subkpi_id=self.report.subkpi_ids[1].id,
)),
],
))],
))
# kpi with a simple expression summing other multi-valued kpis
self.env['mis.report.kpi'].create(dict(
@ -93,8 +89,7 @@ class TestMisReportInstance(common.TransactionCase):
)), (0, 0, dict(
name='1.0',
subkpi_id=self.report.subkpi_ids[1].id,
)),
],
))],
))
# kpi with a NameError (x not defined)
self.env['mis.report.kpi'].create(dict(
@ -108,8 +103,7 @@ class TestMisReportInstance(common.TransactionCase):
)), (0, 0, dict(
name='1.0',
subkpi_id=self.report.subkpi_ids[1].id,
)),
],
))],
))
# create a report instance
self.report_instance = self.env['mis.report.instance'].create(dict(
@ -126,8 +120,7 @@ class TestMisReportInstance(common.TransactionCase):
mode='fix',
manual_date_from='2014-01-01',
manual_date_to='2014-12-31',
)),
],
))],
))
self.report_instance.period_ids[1].comparison_column_ids = \
[(4, self.report_instance.period_ids[0].id, None)]

Loading…
Cancel
Save