|
|
@ -6,6 +6,7 @@ |
|
|
|
<field name="widget_dimension_y">50</field> |
|
|
|
<field name="widget_dimension_x">250</field> |
|
|
|
<field name="background_color">#020202</field> |
|
|
|
<field name="compute_on_fly_refresh">30</field> |
|
|
|
</record> |
|
|
|
|
|
|
|
<record id="widget_number_01" model="kpi.kpi"> |
|
|
@ -87,6 +88,26 @@ result = {"graphs": [ |
|
|
|
<function model="kpi.kpi" name="compute" |
|
|
|
eval="[[ref('widget_graph')]]"/> |
|
|
|
|
|
|
|
<record id="widget_integer" model="kpi.kpi"> |
|
|
|
<field name="name">Integer counter</field> |
|
|
|
<field name="computation_method">code</field> |
|
|
|
<field name="widget">integer</field> |
|
|
|
<field name="compute_on_fly" eval="True"/> |
|
|
|
<field name="code"> |
|
|
|
result = {"value": self.env.context.get('counter', 990)} |
|
|
|
</field> |
|
|
|
</record> |
|
|
|
|
|
|
|
<record id="widget_counter" model="kpi.kpi"> |
|
|
|
<field name="name">Counter</field> |
|
|
|
<field name="computation_method">code</field> |
|
|
|
<field name="widget">counter</field> |
|
|
|
<field name="compute_on_fly" eval="True"/> |
|
|
|
<field name="code"> |
|
|
|
result = {"value": self.env.context.get('counter', 990)} |
|
|
|
</field> |
|
|
|
</record> |
|
|
|
|
|
|
|
<record id="dashboard_widget_text" model="kpi.dashboard.item"> |
|
|
|
<field name="name">Dashboard title</field> |
|
|
|
<field name="dashboard_id" ref="demo_dashboard"/> |
|
|
@ -141,6 +162,40 @@ result = {"graphs": [ |
|
|
|
<field name="font_color">#ffffff</field> |
|
|
|
</record> |
|
|
|
|
|
|
|
<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="row">10</field> |
|
|
|
<field name="size_y">3</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> |
|
|
|
</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="size_y">3</field> |
|
|
|
<field name="color">#4B0082</field> |
|
|
|
<field name="font_color">#ffffff</field> |
|
|
|
</record> |
|
|
|
|
|
|
|
<record id="dashboard_widget_integer" model="kpi.dashboard.item"> |
|
|
|
<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="size_y">3</field> |
|
|
|
<field name="color">#ffffff</field> |
|
|
|
<field name="font_color">#4B0082</field> |
|
|
|
</record> |
|
|
|
|
|
|
|
<record id="dashboard_widget_graph" model="kpi.dashboard.item"> |
|
|
|
<field name="name">Graph</field> |
|
|
|
<field name="dashboard_id" ref="demo_dashboard"/> |
|
|
|