diff --git a/mis_builder/models/mis_report.py b/mis_builder/models/mis_report.py
index 411efdb5..a2e20b30 100644
--- a/mis_builder/models/mis_report.py
+++ b/mis_builder/models/mis_report.py
@@ -53,7 +53,7 @@ class KpiMatrixRow(object):
if not self.account_id:
return self.kpi.style
else:
- return None # TODO style for expanded accounts
+ return self.kpi.auto_expand_accounts_style
@property
def row_id(self):
@@ -421,14 +421,20 @@ class MisReportKpi(models.Model):
inverse='_inverse_expression')
expression_ids = fields.One2many('mis.report.kpi.expression', 'kpi_id')
auto_expand_accounts = fields.Boolean(string='Display details by account')
+ auto_expand_accounts_style = fields.Many2one(
+ string="Style for account detail rows",
+ comodel_name="mis.report.kpi.style",
+ required=False
+ )
style = fields.Many2one(
- string="Default style for KPI",
+ string="Row style",
comodel_name="mis.report.kpi.style",
required=False
)
style_expression = fields.Char(
string='Style expression',
- help='An expression that returns a style name for the kpi style')
+ help='An expression that returns a style depending on the KPI value. '
+ 'Such style is applied on top of the row style.')
type = fields.Selection([('num', _('Numeric')),
('pct', _('Percentage')),
('str', _('String'))],
diff --git a/mis_builder/views/mis_builder.xml b/mis_builder/views/mis_builder.xml
index 40341e5f..7e725031 100644
--- a/mis_builder/views/mis_builder.xml
+++ b/mis_builder/views/mis_builder.xml
@@ -141,8 +141,8 @@
attrs="{'invisible': [('type', '=', 'str')]}"/>
-
-
+
+
@@ -159,8 +159,9 @@
attrs="{'invisible': [('multi', '=', True)],
'readonly': [('multi', '=', True)]}"/>
-
+
+