|
|
@ -165,21 +165,24 @@ result = {"value": self.env.context.get('counter', 990)} |
|
|
|
<record id="dashboard_widget_add_counter" model="kpi.dashboard.item"> |
|
|
|
<field name="name">+1 to Counter</field> |
|
|
|
<field name="dashboard_id" ref="demo_dashboard"/> |
|
|
|
<field name="column">4</field> |
|
|
|
<field name="column">3</field> |
|
|
|
<field name="row">10</field> |
|
|
|
<field name="size_y">3</field> |
|
|
|
<field name="size_y">1</field> |
|
|
|
<field name="size_x">2</field> |
|
|
|
<field name="color">#B41F1F</field> |
|
|
|
<field name="font_color">#EEBF77</field> |
|
|
|
<field name="modify_context" eval="True"/> |
|
|
|
<field name="modify_context_expression">{'counter': (context.counter or 990) + 1}</field> |
|
|
|
<field name="modify_color" eval="True"/> |
|
|
|
<field name="modify_color_expression">check_if(((context.counter or 990) + 1) % 2, '#ff0000', '#00ff00')</field> |
|
|
|
</record> |
|
|
|
|
|
|
|
<record id="dashboard_widget_counter" model="kpi.dashboard.item"> |
|
|
|
<field name="name">Counter</field> |
|
|
|
<field name="dashboard_id" ref="demo_dashboard"/> |
|
|
|
<field name="kpi_id" ref="widget_counter"/> |
|
|
|
<field name="column">2</field> |
|
|
|
<field name="row">10</field> |
|
|
|
<field name="column">3</field> |
|
|
|
<field name="row">11</field> |
|
|
|
<field name="size_y">3</field> |
|
|
|
<field name="color">#4B0082</field> |
|
|
|
<field name="font_color">#ffffff</field> |
|
|
@ -189,8 +192,8 @@ result = {"value": self.env.context.get('counter', 990)} |
|
|
|
<field name="name">Integer</field> |
|
|
|
<field name="dashboard_id" ref="demo_dashboard"/> |
|
|
|
<field name="kpi_id" ref="widget_integer"/> |
|
|
|
<field name="column">3</field> |
|
|
|
<field name="row">10</field> |
|
|
|
<field name="column">4</field> |
|
|
|
<field name="row">11</field> |
|
|
|
<field name="size_y">3</field> |
|
|
|
<field name="color">#ffffff</field> |
|
|
|
<field name="font_color">#4B0082</field> |
|
|
|