mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[IMP] kpi_dashboard: edit color
This commit is contained in:
@@ -119,6 +119,8 @@ class KpiDashboardItem(models.Model):
|
||||
font_color = fields.Char()
|
||||
modify_context = fields.Boolean()
|
||||
modify_context_expression = fields.Char()
|
||||
modify_color = fields.Boolean()
|
||||
modify_color_expression = fields.Char()
|
||||
|
||||
@api.depends('row', 'size_y')
|
||||
def _compute_end_row(self):
|
||||
@@ -176,9 +178,12 @@ class KpiDashboardItem(models.Model):
|
||||
"color": self.color,
|
||||
"font_color": self.font_color or "000000",
|
||||
"modify_context": self.modify_context,
|
||||
"modify_color": self.modify_color,
|
||||
}
|
||||
if self.modify_context:
|
||||
vals['modify_context_expression'] = self.modify_context_expression
|
||||
if self.modify_color:
|
||||
vals['modify_color_expression'] = self.modify_color_expression
|
||||
if self.kpi_id:
|
||||
vals.update(
|
||||
{
|
||||
|
||||
@@ -10,6 +10,7 @@ from odoo.tools.float_utils import float_compare
|
||||
import re
|
||||
import json
|
||||
import datetime
|
||||
from dateutil import relativedelta
|
||||
|
||||
|
||||
class KpiKpi(models.Model):
|
||||
@@ -137,6 +138,7 @@ class KpiKpi(models.Model):
|
||||
"model": self.browse(),
|
||||
"datetime": datetime,
|
||||
"float_compare": float_compare,
|
||||
"relativedelta": relativedelta.relativedelta,
|
||||
}
|
||||
|
||||
def _forbidden_code(self):
|
||||
|
||||
Reference in New Issue
Block a user