Browse Source

[MIG] kpi to v11

pull/267/head
Adrià Gil Sorribes 6 years ago
parent
commit
09bc90889f
  1. 1
      kpi/__init__.py
  2. 3
      kpi/__manifest__.py
  3. 26
      kpi/data/kpi.xml
  4. 1
      kpi/models/__init__.py
  5. 7
      kpi/models/kpi.py
  6. 3
      kpi/models/kpi_category.py
  7. 3
      kpi/models/kpi_history.py
  8. 3
      kpi/models/kpi_threshold.py
  9. 5
      kpi/models/kpi_threshold_range.py
  10. 1
      kpi/tests/__init__.py
  11. 3
      kpi/tests/test_kpi.py
  12. 169
      kpi/views/kpi.xml
  13. 76
      kpi/views/kpi_category.xml
  14. 66
      kpi/views/kpi_history.xml
  15. 94
      kpi/views/kpi_threshold.xml
  16. 131
      kpi/views/kpi_threshold_range.xml
  17. 72
      kpi/views/menu.xml

1
kpi/__init__.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2012 - Now Savoir-faire Linux <https://www.savoirfairelinux.com/>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

3
kpi/__openerp__.py → kpi/__manifest__.py

@ -1,10 +1,9 @@
# -*- coding: utf-8 -*-
# Copyright 2012 - Now Savoir-faire Linux <https://www.savoirfairelinux.com/>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Key Performance Indicator",
"version": "9.0.1.1.0",
"version": "11.0.1.1.0",
"author": "Savoir-faire Linux,Odoo Community Association (OCA)",
"website": "http://www.savoirfairelinux.com",
"license": "AGPL-3",

26
kpi/data/kpi.xml

@ -1,18 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2012 - Now Savoir-faire Linux <https://www.savoirfairelinux.com/>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<data noupdate="1">
<record forcecreate="True" id="ir_cron_kpi_action" model="ir.cron">
<field name="name">Update KPI values</field>
<field name="user_id" ref="base.user_root"/>
<field name="interval_number">1</field>
<field name="interval_type">hours</field>
<field name="numbercall">-1</field>
<field eval="False" name="doall"/>
<field eval="'kpi'" name="model"/>
<field eval="'update_kpi_value'" name="function"/>
<field eval="'()'" name="args"/>
</record>
</data>
<odoo noupdate="1">
<record forcecreate="True" id="ir_cron_kpi_action" model="ir.cron">
<field name="name">Update KPI values</field>
<field name="user_id" ref="base.user_root"/>
<field name="interval_number">1</field>
<field name="interval_type">hours</field>
<field name="numbercall">-1</field>
<field name="doall" eval="False"/>
<field name="model_id" ref="model_kpi"/>
<field name="state">code</field>
<field name="code">model.update_kpi_value()</field>
</record>
</odoo>

1
kpi/models/__init__.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2012 - Now Savoir-faire Linux <https://www.savoirfairelinux.com/>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

7
kpi/models/kpi.py

@ -1,11 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright 2012 - Now Savoir-faire Linux <https://www.savoirfairelinux.com/>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from datetime import datetime, timedelta
from openerp import fields, models, api
from openerp.tools.safe_eval import safe_eval
from openerp.tools import (
from odoo import fields, models, api
from odoo.tools.safe_eval import safe_eval
from odoo.tools import (
DEFAULT_SERVER_DATETIME_FORMAT as DATETIME_FORMAT,
)
import re

3
kpi/models/kpi_category.py

@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright 2012 - Now Savoir-faire Linux <https://www.savoirfairelinux.com/>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import fields, models
from odoo import fields, models
class KPICategory(models.Model):

3
kpi/models/kpi_history.py

@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright 2012 - Now Savoir-faire Linux <https://www.savoirfairelinux.com/>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import fields, models
from odoo import fields, models
class KPIHistory(models.Model):

3
kpi/models/kpi_threshold.py

@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright 2012 - Now Savoir-faire Linux <https://www.savoirfairelinux.com/>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import fields, models, api, exceptions, _
from odoo import fields, models, api, exceptions, _
class KPIThreshold(models.Model):

5
kpi/models/kpi_threshold_range.py

@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
# Copyright 2012 - Now Savoir-faire Linux <https://www.savoirfairelinux.com/>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import fields, models, api
from openerp.tools.safe_eval import safe_eval
from odoo import fields, models, api
from odoo.tools.safe_eval import safe_eval
import re

1
kpi/tests/__init__.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import test_kpi

3
kpi/tests/test_kpi.py

@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp.tests.common import TransactionCase
from odoo.tests.common import TransactionCase
class TestKPI(TransactionCase):

169
kpi/views/kpi.xml

@ -2,98 +2,97 @@
<!-- Copyright 2012 - Now Savoir-faire Linux <https://www.savoirfairelinux.com/>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<data>
<!-- KPI -->
<record id="view_kpi_tree" model="ir.ui.view">
<field name="name">kpi.tree</field>
<field name="model">kpi</field>
<field name="arch" type="xml">
<tree string="Key Performance Indicators">
<!-- KPI -->
<record id="view_kpi_tree" model="ir.ui.view">
<field name="name">kpi.tree</field>
<field name="model">kpi</field>
<field name="arch" type="xml">
<tree string="Key Performance Indicators">
<field name="name"/>
<field name="value" widget="progressbar"/>
<field name="category_id"/>
<field name="kpi_type"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<record id="view_kpi_filter" model="ir.ui.view">
<field name="name">kpi.filter</field>
<field name="model">kpi</field>
<field name="arch" type="xml">
<search string="KPI">
<group>
<filter name="active"
icon="terp-document-new"
domain="[('active','=',True)]"
string="Active"
help="Only active KPIs are computed by the scheduler based on the periodicity configuration."/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="value" widget="progressbar"/>
<field name="category_id"/>
<field name="kpi_type"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<field name="company_id" group="base.group_multi_company"/>
</group>
<newline/>
<group expand="0" name="Group By...">
<filter string="Category" context="{'group_by':'category_id'}"/>
<filter string="Type" context="{'group_by':'kpi_type'}"/>
</group>
</search>
</field>
</record>
<record id="view_kpi_filter" model="ir.ui.view">
<field name="name">kpi.filter</field>
<field name="model">kpi</field>
<field name="arch" type="xml">
<search string="KPI">
<record id="view_kpi_form" model="ir.ui.view">
<field name="name">kpi.form</field>
<field name="model">kpi</field>
<field name="arch" type="xml">
<form string="Key Performance Indicator">
<sheet>
<group>
<filter name="active"
icon="terp-document-new"
domain="[('active','=',True)]"
string="Active"
help="Only active KPIs are computed by the scheduler based on the periodicity configuration."/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="category_id"/>
<field name="company_id" group="base.group_multi_company"/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Category" context="{'group_by':'category_id'}"/>
<filter string="Type" context="{'group_by':'kpi_type'}"/>
</group>
</search>
</field>
</record>
<record id="view_kpi_form" model="ir.ui.view">
<field name="name">kpi.form</field>
<field name="model">kpi</field>
<field name="arch" type="xml">
<form string="Key Performance Indicator">
<sheet>
<group col="6" colspan="6">
<field name="name" colspan="2"/>
<field name="threshold_id" colspan="2"/>
<field name="category_id" colspan="2"/>
<newline/>
<group>
<field name="name" />
<field name="threshold_id" />
<field name="category_id" />
</group>
<group>
<field name="value" colspan="2"/>
<button name="compute_kpi_value" string="Compute KPI Now" colspan="2" type="object"/>
<field name="active" colspan="2"/>
<field name="company_id" groups="base.group_multi_company"/>
<button name="compute_kpi_value" string="Compute KPI Now" colspan="2" type="object"/>
</group>
<notebook colspan="6">
<page string="History">
<field name="history_ids" readonly="1" nolabel="1"/>
</page>
<page string="Computation">
<group col="6">
<field name="periodicity" colspan="2"/>
<field name="periodicity_uom" colspan="2"/>
<field name="next_execution_date" colspan="2"/>
<separator string="KPI Computation" colspan="6"/>
<newline/>
<field name="kpi_type" colspan="2"/>
<field name="dbsource_id" colspan="2" attrs="{'invisible' : [('kpi_type', '!=', 'external')]}"/>
<newline/>
<field name="kpi_code" colspan="6"/>
</group>
</page>
<page string="Description">
<field name="description" nolabel="1"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="open_kpi_list">
<field name="name">Key Performance Indicators</field>
<field name="res_model">kpi</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_kpi_tree"/>
<field name="search_view_id" ref="view_kpi_filter"/>
</record>
</group>
<notebook colspan="6">
<page string="History">
<field name="history_ids" readonly="1" nolabel="1"/>
</page>
<page string="Computation">
<group col="6">
<field name="periodicity" colspan="3"/>
<field name="periodicity_uom" colspan="3"/>
<field name="next_execution_date" colspan="3"/>
<separator string="KPI Computation" colspan="6"/>
<newline/>
<field name="kpi_type" colspan="2"/>
<field name="dbsource_id" colspan="2" attrs="{'invisible' : [('kpi_type', '!=', 'external')]}"/>
<newline/>
<field name="kpi_code" colspan="6"/>
</group>
</page>
<page string="Description">
<field name="description" nolabel="1"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
</data>
<record model="ir.actions.act_window" id="open_kpi_list">
<field name="name">Key Performance Indicators</field>
<field name="res_model">kpi</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_kpi_tree"/>
<field name="search_view_id" ref="view_kpi_filter"/>
</record>
</odoo>

76
kpi/views/kpi_category.xml

@ -3,45 +3,39 @@
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<data>
<!-- Categories -->
<record id="view_kpi_category_tree" model="ir.ui.view">
<field name="name">kpi.category.tree</field>
<field name="model">kpi.category</field>
<field name="arch" type="xml">
<tree string="Categories">
<field name="name"/>
</tree>
</field>
</record>
<record id="view_kpi_category_form" model="ir.ui.view">
<field name="name">kpi.category.form</field>
<field name="model">kpi.category</field>
<field name="arch" type="xml">
<form string="Category">
<sheet>
<group col="2" colspan="2">
<field name="name" colspan="2"/>
<newline/>
<field name="description" colspan="2"/>
</group>
</sheet>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="open_category_list">
<field name="name">Categories</field>
<field name="res_model">kpi.category</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_kpi_category_tree"/>
</record>
</data>
<!-- Categories -->
<record id="view_kpi_category_tree" model="ir.ui.view">
<field name="name">kpi.category.tree</field>
<field name="model">kpi.category</field>
<field name="arch" type="xml">
<tree string="Categories">
<field name="name"/>
</tree>
</field>
</record>
<record id="view_kpi_category_form" model="ir.ui.view">
<field name="name">kpi.category.form</field>
<field name="model">kpi.category</field>
<field name="arch" type="xml">
<form string="Category">
<sheet>
<group col="2" colspan="2">
<field name="name" colspan="2"/>
<newline/>
<field name="description" colspan="2"/>
</group>
</sheet>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="open_category_list">
<field name="name">Categories</field>
<field name="res_model">kpi.category</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_kpi_category_tree"/>
</record>
</odoo>

66
kpi/views/kpi_history.xml

@ -3,38 +3,36 @@
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<data>
<!-- KPI history -->
<record id="view_kpi_history_tree" model="ir.ui.view">
<field name="name">kpi.history.tree</field>
<field name="model">kpi.history</field>
<field name="arch" type="xml">
<tree string="KPI History">
<field name="name"/>
<field name="date"/>
<field name="value"/>
<field name="color" widget="color"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<record id="view_kpi_history_form" model="ir.ui.view">
<field name="name">kpi.history.form</field>
<field name="model">kpi.history</field>
<field name="arch" type="xml">
<form string="KPI History">
<sheet>
<group col="4" colspan="4">
<field name="kpi_id"/>
<field name="name"/>
<field name="date"/>
<field name="value"/>
<field name="color" widget="color"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
</sheet>
</form>
</field>
</record>
</data>
<!-- KPI history -->
<record id="view_kpi_history_tree" model="ir.ui.view">
<field name="name">kpi.history.tree</field>
<field name="model">kpi.history</field>
<field name="arch" type="xml">
<tree string="KPI History">
<field name="name"/>
<field name="date"/>
<field name="value"/>
<field name="color" widget="color"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<record id="view_kpi_history_form" model="ir.ui.view">
<field name="name">kpi.history.form</field>
<field name="model">kpi.history</field>
<field name="arch" type="xml">
<form string="KPI History">
<sheet>
<group col="4" colspan="4">
<field name="kpi_id"/>
<field name="name"/>
<field name="date"/>
<field name="value"/>
<field name="color" widget="color"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
</sheet>
</form>
</field>
</record>
</odoo>

94
kpi/views/kpi_threshold.xml

@ -3,55 +3,51 @@
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<data>
<!-- Thresholds -->
<record id="view_kpi_threshold_tree" model="ir.ui.view">
<field name="name">kpi.threshold.tree</field>
<field name="model">kpi.threshold</field>
<field name="arch" type="xml">
<tree string="Thresholds" decoration-danger="invalid_message">
<field name="name"/>
<field name="invalid_message"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<!-- Thresholds -->
<record id="view_kpi_threshold_tree" model="ir.ui.view">
<field name="name">kpi.threshold.tree</field>
<field name="model">kpi.threshold</field>
<field name="arch" type="xml">
<tree string="Thresholds" decoration-danger="invalid_message">
<field name="name"/>
<field name="invalid_message"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<record id="view_kpi_threshold_form" model="ir.ui.view">
<field name="name">kpi.threshold.form</field>
<field name="model">kpi.threshold</field>
<field name="arch" type="xml">
<form string="Threshold">
<sheet>
<group col="6" colspan="6">
<field name="name" colspan="2"/>
<field name="company_id" groups="base.group_multi_company" colspan="2"/>
<newline/>
<separator string="Ranges" colspan="6"/>
<newline/>
<field name="range_ids" nolabel="1" colspan="6"/>
<newline/>
<separator string="KPIs" colspan="6"/>
<newline/>
<field name="kpi_ids" nolabel="1" colspan="6"/>
<newline/>
<separator string="Errors" attrs="{'invisible' : [('invalid_message', '=', False)]}" colspan="4"/>
<field name="invalid_message" nolabel="1" attrs="{'invisible' : [('invalid_message', '=', False)]}" colspan="4"/>
<newline/>
</group>
</sheet>
</form>
</field>
</record>
<record id="view_kpi_threshold_form" model="ir.ui.view">
<field name="name">kpi.threshold.form</field>
<field name="model">kpi.threshold</field>
<field name="arch" type="xml">
<form string="Threshold">
<sheet>
<group col="6" colspan="6">
<field name="name" colspan="2"/>
<field name="company_id" groups="base.group_multi_company" colspan="2"/>
<newline/>
<separator string="Ranges" colspan="6"/>
<newline/>
<field name="range_ids" nolabel="1" colspan="6"/>
<newline/>
<separator string="KPIs" colspan="6"/>
<newline/>
<field name="kpi_ids" nolabel="1" colspan="6"/>
<newline/>
<separator string="Errors" attrs="{'invisible' : [('invalid_message', '=', False)]}" colspan="4"/>
<field name="invalid_message" nolabel="1" attrs="{'invisible' : [('invalid_message', '=', False)]}" colspan="4"/>
<newline/>
</group>
</sheet>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="open_threshold_list">
<field name="name">Thresholds</field>
<field name="res_model">kpi.threshold</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_kpi_threshold_tree"/>
</record>
</data>
<record model="ir.actions.act_window" id="open_threshold_list">
<field name="name">Thresholds</field>
<field name="res_model">kpi.threshold</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_kpi_threshold_tree"/>
</record>
</odoo>

131
kpi/views/kpi_threshold_range.xml

@ -3,74 +3,69 @@
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<data>
<!-- Ranges -->
<record id="view_kpi_threshold_range_tree" model="ir.ui.view">
<field name="name">kpi.threshold.range.tree</field>
<field name="model">kpi.threshold.range</field>
<field name="arch" type="xml">
<tree string="Ranges" decoration-danger="invalid_message">
<field name="name"/>
<field name="min_value"/>
<field name="max_value"/>
<field name="color" widget="color"/>
<field name="invalid_message"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<!-- Ranges -->
<record id="view_kpi_threshold_range_tree" model="ir.ui.view">
<field name="name">kpi.threshold.range.tree</field>
<field name="model">kpi.threshold.range</field>
<field name="arch" type="xml">
<tree string="Ranges" decoration-danger="invalid_message">
<field name="name"/>
<field name="min_value"/>
<field name="max_value"/>
<field name="color" widget="color"/>
<field name="invalid_message"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<record id="view_kpi_threshold_range_form" model="ir.ui.view">
<field name="name">kpi.threshold.range.form</field>
<field name="model">kpi.threshold.range</field>
<field name="arch" type="xml">
<form string="Range">
<sheet>
<group col="6" colspan="6">
<field name="name"/>
<field name="color"/>
<field name="company_id" groups="base.group_multi_company"/>
<newline/>
<record id="view_kpi_threshold_range_form" model="ir.ui.view">
<field name="name">kpi.threshold.range.form</field>
<field name="model">kpi.threshold.range</field>
<field name="arch" type="xml">
<form string="Range">
<sheet>
<group col="6" colspan="6">
<field name="name" colspan="2"/>
<field name="color" colspan="2"/>
<field name="company_id" groups="base.group_multi_company" colspan="2" />
</group>
<group col="6">
<separator string="Minimum"/>
<newline/>
<field name="min_type" colspan="3"/>
<field name="min_fixed_value" colspan="3" attrs="{'invisible' : [('min_type', '!=', 'static')]}"/>
<field name="min_dbsource_id" colspan="3" attrs="{'invisible' : [('min_type', '!=', 'external')]}"/>
<field name="min_code" colspan="6" attrs="{'invisible' : [('min_type', 'not in', ('local','external','python'))]}"/>
<field name="min_error" colspan="6" attrs="{'invisible': [('min_error', '=', False)]}" />
<newline/>
<separator string="Maximum"/>
<newline/>
<field name="max_type" colspan="3"/>
<field name="max_fixed_value" colspan="3" attrs="{'invisible' : [('max_type', '!=', 'static')]}"/>
<field name="max_dbsource_id" colspan="3" attrs="{'invisible' : [('max_type', '!=', 'external')]}"/>
<newline/>
<field name="max_code" colspan="6" attrs="{'invisible' : [('max_type', 'not in', ('local','external','python'))]}"/>
<newline/>
<field name="max_error" colspan="6" attrs="{'invisible': [('max_error', '=', False)]}" />
<newline/>
</group>
<group col="6" colspan="6">
<separator string="Thresholds" colspan="4"/>
<field name="threshold_ids" nolabel="1" colspan="4"/>
<separator string="Errors" attrs="{'invisible' : [('invalid_message', '=', False)]}" colspan="4"/>
<field name="invalid_message" nolabel="1" attrs="{'invisible' : [('invalid_message', '=', False)]}" colspan="4"/>
</group>
</sheet>
</form>
</field>
</record>
<separator string="Minimum" colspan="4"/>
<newline/>
<field name="min_type" colspan="2"/>
<field name="min_fixed_value" colspan="2" attrs="{'invisible' : [('min_type', '!=', 'static')]}"/>
<field name="min_dbsource_id" colspan="2" attrs="{'invisible' : [('min_type', '!=', 'external')]}"/>
<newline/>
<field name="min_code" colspan="6" attrs="{'invisible' : [('min_type', 'NOT IN', ('local','external','python'))]}"/>
<newline/>
<field name="min_error" colspan="6" attrs="{'invisible': [('min_error', '=', False)]}" />
<newline/>
<separator string="Maximum" colspan="4"/>
<newline/>
<field name="max_type"/>
<field name="max_fixed_value" attrs="{'invisible' : [('max_type', '!=', 'static')]}"/>
<field name="max_dbsource_id" attrs="{'invisible' : [('max_type', '!=', 'external')]}"/>
<newline/>
<field name="max_code" colspan="6" attrs="{'invisible' : [('max_type', 'NOT IN', ('local','external','python'))]}"/>
<newline/>
<field name="max_error" colspan="6" attrs="{'invisible': [('max_error', '=', False)]}" />
<newline/>
<separator string="Thresholds" colspan="4"/>
<field name="threshold_ids" nolabel="1" colspan="4"/>
<separator string="Errors" attrs="{'invisible' : [('invalid_message', '=', False)]}" colspan="4"/>
<field name="invalid_message" nolabel="1" attrs="{'invisible' : [('invalid_message', '=', False)]}" colspan="4"/>
</group>
</sheet>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="open_threshold_range_list">
<field name="name">Ranges</field>
<field name="res_model">kpi.threshold.range</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_kpi_threshold_range_tree"/>
</record>
</data>
<record model="ir.actions.act_window" id="open_threshold_range_list">
<field name="name">Ranges</field>
<field name="res_model">kpi.threshold.range</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_kpi_threshold_range_tree"/>
</record>
</odoo>

72
kpi/views/menu.xml

@ -3,46 +3,44 @@
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<data>
<menuitem id="menu_reporting_kpi"
name="KPI"
action="open_kpi_list"
sequence="15"
parent="base.menu_reporting_dashboard"
groups="base.group_user"/>
<menuitem id="menu_reporting_kpi"
name="KPI"
action="open_kpi_list"
sequence="15"
parent="base.menu_reporting_dashboard"
groups="base.group_user"/>
<menuitem id="menu_configuration_kpi"
name="KPI"
parent="base.menu_reporting_config"
groups="base.group_user"
sequence="20"/>
<menuitem id="menu_configuration_kpi"
name="KPI"
parent="base.menu_reporting_config"
groups="base.group_user"
sequence="20"/>
<menuitem id="menu_configuration_kpi_category"
name="Categories"
action="open_category_list"
parent="menu_configuration_kpi"
groups="base.group_user"
sequence="10"/>
<menuitem id="menu_configuration_kpi_category"
name="Categories"
action="open_category_list"
parent="menu_configuration_kpi"
groups="base.group_user"
sequence="10"/>
<menuitem id="menu_configuration_kpi_range"
name="Ranges"
action="open_threshold_range_list"
parent="menu_configuration_kpi"
groups="base.group_user"
sequence="20"/>
<menuitem id="menu_configuration_kpi_range"
name="Ranges"
action="open_threshold_range_list"
parent="menu_configuration_kpi"
groups="base.group_user"
sequence="20"/>
<menuitem id="menu_configuration_kpi_dbsource"
name="Data Sources"
action="base_external_dbsource.action_dbsource"
parent="menu_configuration_kpi"
groups="base.group_user"
sequence="20"/>
<menuitem id="menu_configuration_kpi_dbsource"
name="Data Sources"
action="base_external_dbsource.action_dbsource"
parent="menu_configuration_kpi"
groups="base.group_user"
sequence="20"/>
<menuitem id="menu_configuration_kpi_threshold"
name="Thresholds"
action="open_threshold_list"
parent="menu_configuration_kpi"
groups="base.group_user"
sequence="10"/>
</data>
<menuitem id="menu_configuration_kpi_threshold"
name="Thresholds"
action="open_threshold_list"
parent="menu_configuration_kpi"
groups="base.group_user"
sequence="10"/>
</odoo>
Loading…
Cancel
Save