kpi fix
This commit is contained in:
parent
093a0a47af
commit
fa01ac0106
|
|
@ -10,7 +10,6 @@
|
|||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="interval_number">8</field>
|
||||
<field name="interval_type">hours</field>
|
||||
<field name="numbercall">-1</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ class kpi_category(models.Model):
|
|||
"text": self.name,
|
||||
"id": self.id,
|
||||
}
|
||||
if self._context.get("show_tooltip") and hasattr(self, "description") and self.description not in EMPTYHTML:
|
||||
if self._context.get("show_tooltip") and hasattr(self, "description") :
|
||||
res.update({"a_attr": {"kn_tip": self.description},})
|
||||
child_res = []
|
||||
for child in self.child_ids.sorted(lambda ch: ch.sequence):
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class kpi_scorecard_line(models.Model):
|
|||
)
|
||||
description = fields.Text(
|
||||
related="kpi_id.description",
|
||||
store=True,
|
||||
|
||||
)
|
||||
period_id = fields.Many2one(
|
||||
"kpi.period",
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@
|
|||
<field name="active"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Help" attrs="{'invisible': [('help_notes', '=', False)]}">
|
||||
<page string="Help" invisible="not help_notes">
|
||||
<field name="kpi_help_dummy" invisible="1"/>
|
||||
<field name="help_notes"/>
|
||||
</page>
|
||||
|
|
@ -92,19 +92,19 @@
|
|||
<field name="name">kpi.category.tree</field>
|
||||
<field name="model">kpi.category</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<list>
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name='name'/>
|
||||
<field name="parent_id"/>
|
||||
<field name="active" invisible="1"/>
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
<record id="kpi_category_action" model="ir.actions.act_window">
|
||||
<field name="name">KPI Categories</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">kpi.category</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="search_view_id" eval="kpi_category_view_search"/>
|
||||
</record>
|
||||
|
||||
|
|
|
|||
|
|
@ -41,10 +41,10 @@
|
|||
<notebook>
|
||||
<page string="By Periods">
|
||||
<field name="periods_ids">
|
||||
<tree editable="top">
|
||||
<list editable="top">
|
||||
<field name="period_id" options="{'no_create_edit':1, 'no_quick_create': 1}"/>
|
||||
<field name="target_value"/>
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Notes">
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
<field name="active"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Help" attrs="{'invisible': [('help_notes', '=', False)]}">
|
||||
<page string="Help" invisible="not help_notes">
|
||||
<field name="kpi_help_dummy" invisible="1"/>
|
||||
<field name="help_notes"/>
|
||||
</page>
|
||||
|
|
@ -69,18 +69,18 @@
|
|||
<field name="name">kpi.constant.tree</field>
|
||||
<field name="model">kpi.constant</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<list>
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name='name'/>
|
||||
<field name="active" invisible="1"/>
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
<record id="kpi_constant_action" model="ir.actions.act_window">
|
||||
<field name="name">Constants</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">kpi.constant</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="search_view_id" eval="kpi_constant_view_search"/>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
</h1>
|
||||
</div>
|
||||
<h2 class="oe_read_only pull-right text-warning"
|
||||
attrs="{'invisible': [('formula_warning', '=', False)]}"
|
||||
invisible="not formula_warning "
|
||||
>
|
||||
<field name="formula_warning"/>
|
||||
</h2>
|
||||
|
|
@ -58,13 +58,13 @@
|
|||
<field name="result_type"/>
|
||||
<field name="result_appearance"/>
|
||||
<field name="result_preffix"
|
||||
attrs="{'invisible': [('result_appearance', '=', 'monetory')]}"
|
||||
invisible="result_appearance in [ 'monetory']"
|
||||
/>
|
||||
<field name="result_suffix"
|
||||
attrs="{'invisible': [('result_appearance', '=', 'monetory')]}"
|
||||
invisible="result_appearance in [ 'monetory']"
|
||||
/>
|
||||
<field name="currency_id"
|
||||
attrs="{'invisible': [('result_appearance', '!=', 'monetory')]}"
|
||||
invisible="result_appearance not in [ 'monetory']"
|
||||
/>
|
||||
<field name="result_rounding"/>
|
||||
</group>
|
||||
|
|
@ -124,7 +124,7 @@
|
|||
/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Help" attrs="{'invisible': [('help_notes', '=', False)]}">
|
||||
<page string="Help" invisible="not help_notes">
|
||||
<field name="kpi_help_dummy" invisible="1"/>
|
||||
<field name="help_notes"/>
|
||||
</page>
|
||||
|
|
@ -136,19 +136,19 @@
|
|||
<field name="name">kpi.item.tree</field>
|
||||
<field name="model">kpi.item</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree decoration-warning="formula_warning != False">
|
||||
<list decoration-warning="formula_warning != False">
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="name"/>
|
||||
<field name="active" invisible="1"/>
|
||||
<field name="formula_warning" invisible="0"/>
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
<record id="kpi_item_action" model="ir.actions.act_window">
|
||||
<field name="name">KPI</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">kpi.item</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="search_view_id" eval="kpi_item_view_search"/>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
type="action"
|
||||
class="oe_stat_button"
|
||||
icon="fa-list"
|
||||
context="{'search_default_measure_id': active_id, 'default_measure_id': active_id}"
|
||||
context="{'search_default_measure_id': id, 'default_measure_id': id}"
|
||||
>
|
||||
<field string="Measurements"
|
||||
name="measures_len"
|
||||
|
|
@ -61,7 +61,8 @@
|
|||
<field name="measure_type"/>
|
||||
</group>
|
||||
<field name="py_code"
|
||||
attrs="{'invisible': [('measure_type', 'not in', ['py_code'])], 'required': [('measure_type', 'in', ['py_code'])]}"
|
||||
invisible="measure_type != 'py_code'"
|
||||
required="measure_type == 'py_code'"
|
||||
widget="ace"
|
||||
options="{'mode': 'python'}"
|
||||
/>
|
||||
|
|
@ -72,7 +73,7 @@
|
|||
nolabel="1"
|
||||
style="color:red;"
|
||||
/>
|
||||
<group attrs="{'invisible': [('measure_type', 'not in', ['sum', 'average', 'count'])]}">
|
||||
<group invisible="measure_type not in ['sum', 'average', 'count']">
|
||||
<field name="model_id"
|
||||
options="{'no_create_edit': 1, 'no_quick_create': 1}"
|
||||
/>
|
||||
|
|
@ -81,7 +82,9 @@
|
|||
('model', '=', model_name),
|
||||
('ttype', 'in', ['integer', 'float', 'monetary']),
|
||||
]"
|
||||
attrs="{'invisible':['|', ('model_id', '=', False), ('measure_type', '=', 'count')], 'required': [('measure_type', 'in', ['sum', 'average']), ('model_id', '!=', False)]}"
|
||||
invisible="not model_id or measure_type == 'count'"
|
||||
required="measure_type in ['sum', 'average'] and model_id"
|
||||
|
||||
options="{'no_create_edit': 1, 'no_quick_create': 1}"
|
||||
/>
|
||||
<field name="date_field_ids"
|
||||
|
|
@ -90,7 +93,7 @@
|
|||
('ttype', 'in', ['date', 'datetime']),
|
||||
('store', '=', True),
|
||||
]"
|
||||
attrs="{'invisible': [('model_id', '=', False)]}"
|
||||
invisible="not model_id"
|
||||
options="{'no_create_edit': 1, 'no_quick_create': 1}"
|
||||
widget="many2many_tags"
|
||||
/>
|
||||
|
|
@ -100,13 +103,13 @@
|
|||
('ttype', 'in', ['many2one']),
|
||||
('relation', '=', 'res.company'),
|
||||
]"
|
||||
attrs="{'invisible':[('model_id', '=', False)]}"
|
||||
invisible="not model_id"
|
||||
options="{'no_create_edit': 1, 'no_quick_create': 1}"
|
||||
/>
|
||||
<field name="domain"
|
||||
widget="domain"
|
||||
options="{'model': 'model_name'}"
|
||||
attrs="{'invisible': ['|', ('model_id', '=', False), ('measure_type', 'not in', ['sum', 'average', 'count'])]}"
|
||||
invisible="not model_id or measure_type not in ['sum', 'average', 'count']"
|
||||
style="min-height:200px !important;"
|
||||
/>
|
||||
</group>
|
||||
|
|
@ -119,21 +122,21 @@
|
|||
<group>
|
||||
<field name="sequence"/>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('measure_type', 'not in', ['sum', 'average', 'count'])]}">
|
||||
<group invisible="measure_type not in ['sum', 'average', 'count']">
|
||||
<field name="model_name"
|
||||
readonly="1"
|
||||
/>
|
||||
<field name="measure_field_name"
|
||||
readonly="1"
|
||||
attrs="{'invisible':['|', ('model_name', '=', False), ('measure_type', '=', 'count')]}"
|
||||
invisible="not model_name or measure_type == 'count'"
|
||||
/>
|
||||
<field name="date_field_name"
|
||||
readonly="1"
|
||||
attrs="{'invisible': [('model_name', '=', False)]}"
|
||||
/>
|
||||
readonly="1"
|
||||
invisible="not model_name"
|
||||
/>
|
||||
<field name="company_field_name"
|
||||
readonly="1"
|
||||
attrs="{'invisible': [('model_name', '=', False)]}"
|
||||
invisible="not model_name"
|
||||
/>
|
||||
</group>
|
||||
</group>
|
||||
|
|
@ -141,7 +144,7 @@
|
|||
<field name="active"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Help" attrs="{'invisible': [('help_notes', '=', False)]}">
|
||||
<page string="Help" invisible="not help_notes">
|
||||
<field name="kpi_help_dummy" invisible="1"/>
|
||||
<field name="help_notes"/>
|
||||
</page>
|
||||
|
|
@ -154,21 +157,21 @@
|
|||
<field name="name">kpi.measure.tree</field>
|
||||
<field name="model">kpi.measure</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree decoration-muted="existing_kpi != False">
|
||||
<list decoration-muted="existing_kpi != False">
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name='name'/>
|
||||
<field name='model_name'/>
|
||||
<field name='measure_type'/>
|
||||
<field name="active" invisible="1"/>
|
||||
<field name="existing_kpi" invisible="1"/>
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
<record id="kpi_measure_action" model="ir.actions.act_window">
|
||||
<field name="name">Basic Measurements</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">kpi.measure</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="search_view_id" eval="kpi_measure_view_search"/>
|
||||
<field name="context">{'search_default_installed_kpis': 1}</field>
|
||||
<field name="help" type="html">
|
||||
|
|
|
|||
|
|
@ -53,7 +53,8 @@
|
|||
widget="domain"
|
||||
options="{'model': 'model_name'}"
|
||||
style="min-height:200px !important;"
|
||||
attrs="{'invisible': ['|', ('model_name', '=', False), ('measure_type', 'not in', ['sum', 'average', 'count'])]}"
|
||||
invisible="not model_name or measure_type not in ['sum', 'average', 'count']"
|
||||
|
||||
/>
|
||||
</group>
|
||||
<notebook>
|
||||
|
|
@ -68,7 +69,7 @@
|
|||
<field name="measure_type" invisible="1"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Help" attrs="{'invisible': [('help_notes', '=', False)]}">
|
||||
<page string="Help" invisible="not help_notes" >
|
||||
<field name="kpi_help_dummy" invisible="1"/>
|
||||
<field name="help_notes"/>
|
||||
</page>
|
||||
|
|
@ -81,19 +82,19 @@
|
|||
<field name="name">kpi.measure.item.tree</field>
|
||||
<field name="model">kpi.measure.item</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<list>
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name='name'/>
|
||||
<field name="measure_id"/>
|
||||
<field name="active" invisible="1"/>
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
<record id="kpi_measure_item_action" model="ir.actions.act_window">
|
||||
<field name="name">Measurements (Variables)</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">kpi.measure.item</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="search_view_id" eval="kpi_measure_item_view_search"/>
|
||||
<field name="domain">[('existing_kpi', '!=', False)]</field>
|
||||
<field name="help" type="html">
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
type="object"
|
||||
class="oe_stat_button"
|
||||
icon="fa-stop"
|
||||
attrs="{'invisible': [('state', 'not in', ['open'])]}"
|
||||
invisible="state not in ['open']"
|
||||
>
|
||||
Close Period
|
||||
</button>
|
||||
|
|
@ -53,7 +53,7 @@
|
|||
type="object"
|
||||
class="oe_stat_button"
|
||||
icon="fa-refresh"
|
||||
attrs="{'invisible': [('state', 'not in', ['closed'])]}"
|
||||
invisible="state not in ['closed']"
|
||||
>
|
||||
Re-Open Period
|
||||
</button>
|
||||
|
|
@ -61,8 +61,9 @@
|
|||
type="action"
|
||||
class="oe_stat_button"
|
||||
icon="fa-exchange"
|
||||
attrs="{'invisible': [('state', 'not in', ['open'])]}"
|
||||
context="{'default_period_id': active_id}"
|
||||
invisible="state not in ['open']"
|
||||
|
||||
context="{'default_period_id': id}"
|
||||
>
|
||||
Substitute Targets
|
||||
</button>
|
||||
|
|
@ -80,11 +81,12 @@
|
|||
<div>
|
||||
<field name="date_start"
|
||||
class="oe_inline"
|
||||
attrs="{'readonly': [('state', 'not in', 'open')]}"
|
||||
readonly="state not in ['open']"
|
||||
|
||||
/> to
|
||||
<field name="date_end"
|
||||
class="oe_inline"
|
||||
attrs="{'readonly': [('state', 'not in', 'open')]}"
|
||||
readonly="state not in ['open']"
|
||||
/>
|
||||
</div>
|
||||
<field name="template_id"
|
||||
|
|
@ -99,12 +101,13 @@
|
|||
<notebook invisible="context.get('quick_kpi_period')">
|
||||
<page string="Targets">
|
||||
<field name="line_ids"
|
||||
attrs="{'readonly': [('state', 'not in', 'open')]}"
|
||||
readonly="state not in ['open']"
|
||||
|
||||
>
|
||||
<tree editable="bottom">
|
||||
<list editable="bottom">
|
||||
<field name="kpi_id"/>
|
||||
<field name="target_value"/>
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Misc">
|
||||
|
|
@ -114,7 +117,7 @@
|
|||
/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Help" attrs="{'invisible': [('help_notes', '=', False)]}">
|
||||
<page string="Help" invisible="not help_notes">
|
||||
<field name="kpi_help_dummy" invisible="1"/>
|
||||
<field name="help_notes"/>
|
||||
</page>
|
||||
|
|
@ -127,19 +130,19 @@
|
|||
<field name="name">kpi.period.tree</field>
|
||||
<field name="model">kpi.period</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree decoration-muted="state == 'closed'">
|
||||
<list decoration-muted="state == 'closed'">
|
||||
<field name="name"/>
|
||||
<field name="date_start"/>
|
||||
<field name="date_end"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
<record id="kpi_period_action" model="ir.actions.act_window">
|
||||
<field name="name">Periods</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">kpi.period</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="search_view_id" eval="kpi_period_view_search"/>
|
||||
<field name="context">{'search_default_open_periods': 1}</field>
|
||||
<field name="help" type="html">
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
invisible="1"
|
||||
/>
|
||||
</group>
|
||||
<div attrs="{'invisible': [('help_notes', '=', False)]}">
|
||||
<div invisible="not help_notes">
|
||||
<field name="kpi_help_dummy" invisible="1"/>
|
||||
<label for="help_notes" invisible="1"/>
|
||||
<field name="help_notes"/>
|
||||
|
|
@ -49,7 +49,7 @@
|
|||
<field name="name">kpi.scorecard.line.kanban</field>
|
||||
<field name="model">kpi.scorecard.line</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban js_class="scorecard_kanban"
|
||||
<kanban
|
||||
class="kpi-kanban-view"
|
||||
group_create="0"
|
||||
group_delete="0"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<field name="model">res.config.settings</field>
|
||||
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[hasclass('settings')]" position="inside">
|
||||
<xpath expr="//form" position="inside">
|
||||
<div class="app_settings_block"
|
||||
data-string="KPI Scorecard"
|
||||
string="KPI Scorecard"
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
<odoo>
|
||||
|
||||
<template id="assets_backend" name="list asssets" inherit_id="web.assets_backend">
|
||||
<xpath expr="." position="inside">
|
||||
<!-- Formula -->
|
||||
<script type="text/javascript" src="/kpi_scorecard/static/src/js/kpi_formula.js"/>
|
||||
<link type="text/css" rel='stylesheet' href='/kpi_scorecard/static/src/css/kpi_widgets.css'/>
|
||||
<!-- Kanban -->
|
||||
<script type="text/javascript" src="/kpi_scorecard/static/src/js/scorecard_kanbancontroller.js"/>
|
||||
<script type="text/javascript" src="/kpi_scorecard/static/src/js/scorecard_kanbanmodel.js"/>
|
||||
<script type="text/javascript" src="/kpi_scorecard/static/src/js/scorecard_kanbanview.js"/>
|
||||
<link type="text/css" rel='stylesheet' href='/kpi_scorecard/static/src/css/kpi_kanban.css'/>
|
||||
</xpath>
|
||||
</template>
|
||||
<!-- <template id="assets_backend" name="list asssets" inherit_id="web.assets_backend">-->
|
||||
<!-- <xpath expr="." position="inside">-->
|
||||
<!-- <!– Formula –>-->
|
||||
<!-- <script type="text/javascript" src="/kpi_scorecard/static/src/js/kpi_formula.js"/>-->
|
||||
<!-- <link type="text/css" rel='stylesheet' href='/kpi_scorecard/static/src/css/kpi_widgets.css'/>-->
|
||||
<!-- <!– Kanban –>-->
|
||||
<!-- <script type="text/javascript" src="/kpi_scorecard/static/src/js/scorecard_kanbancontroller.js"/>-->
|
||||
<!-- <script type="text/javascript" src="/kpi_scorecard/static/src/js/scorecard_kanbanmodel.js"/>-->
|
||||
<!-- <script type="text/javascript" src="/kpi_scorecard/static/src/js/scorecard_kanbanview.js"/>-->
|
||||
<!-- <link type="text/css" rel='stylesheet' href='/kpi_scorecard/static/src/css/kpi_kanban.css'/>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- </template>-->
|
||||
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
options="{'no_create_edit': 1, 'no_quick_create': 1}"
|
||||
/>
|
||||
</group>
|
||||
<div attrs="{'invisible': [('help_notes', '=', False)]}">
|
||||
<div invisible="not help_notes">
|
||||
<field name="kpi_help_dummy" invisible="1"/>
|
||||
<label for="help_notes" invisible="1"/>
|
||||
<field name="help_notes"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue