|
@ -53,7 +53,7 @@ class KpiMatrixRow(object): |
|
|
if not self.account_id: |
|
|
if not self.account_id: |
|
|
return self.kpi.style |
|
|
return self.kpi.style |
|
|
else: |
|
|
else: |
|
|
return None # TODO style for expanded accounts |
|
|
|
|
|
|
|
|
return self.kpi.auto_expand_accounts_style |
|
|
|
|
|
|
|
|
@property |
|
|
@property |
|
|
def row_id(self): |
|
|
def row_id(self): |
|
@ -421,14 +421,20 @@ class MisReportKpi(models.Model): |
|
|
inverse='_inverse_expression') |
|
|
inverse='_inverse_expression') |
|
|
expression_ids = fields.One2many('mis.report.kpi.expression', 'kpi_id') |
|
|
expression_ids = fields.One2many('mis.report.kpi.expression', 'kpi_id') |
|
|
auto_expand_accounts = fields.Boolean(string='Display details by account') |
|
|
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( |
|
|
style = fields.Many2one( |
|
|
string="Default style for KPI", |
|
|
|
|
|
|
|
|
string="Row style", |
|
|
comodel_name="mis.report.kpi.style", |
|
|
comodel_name="mis.report.kpi.style", |
|
|
required=False |
|
|
required=False |
|
|
) |
|
|
) |
|
|
style_expression = fields.Char( |
|
|
style_expression = fields.Char( |
|
|
string='Style expression', |
|
|
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')), |
|
|
type = fields.Selection([('num', _('Numeric')), |
|
|
('pct', _('Percentage')), |
|
|
('pct', _('Percentage')), |
|
|
('str', _('String'))], |
|
|
('str', _('String'))], |
|
|