|
@ -21,13 +21,13 @@ |
|
|
|
|
|
|
|
|
from dateutil.relativedelta import relativedelta |
|
|
from dateutil.relativedelta import relativedelta |
|
|
from datetime import datetime |
|
|
from datetime import datetime |
|
|
from osv import fields, osv |
|
|
|
|
|
|
|
|
from osv import fields, orm, osv |
|
|
from openerp.tools.translate import _ |
|
|
from openerp.tools.translate import _ |
|
|
import openerp.tools as tools |
|
|
|
|
|
import time |
|
|
import time |
|
|
import logging |
|
|
import logging |
|
|
_logger = logging.getLogger(__name__) |
|
|
_logger = logging.getLogger(__name__) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def is_one_value(result): |
|
|
def is_one_value(result): |
|
|
# check if sql query returns only one value |
|
|
# check if sql query returns only one value |
|
|
if type(result) is dict and 'value' in result.dictfetchone(): |
|
|
if type(result) is dict and 'value' in result.dictfetchone(): |
|
@ -37,6 +37,7 @@ def is_one_value(result): |
|
|
else: |
|
|
else: |
|
|
return False |
|
|
return False |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def is_select_query(query): |
|
|
def is_select_query(query): |
|
|
# check if sql query is a SELECT statement |
|
|
# check if sql query is a SELECT statement |
|
|
|
|
|
|
|
@ -45,7 +46,8 @@ def is_select_query(query): |
|
|
return False |
|
|
return False |
|
|
return True |
|
|
return True |
|
|
|
|
|
|
|
|
class mgmtsystem_kpi_category(osv.osv): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class mgmtsystem_kpi_category(orm.Model): |
|
|
""" |
|
|
""" |
|
|
KPI Category |
|
|
KPI Category |
|
|
""" |
|
|
""" |
|
@ -56,9 +58,8 @@ class mgmtsystem_kpi_category(osv.osv): |
|
|
'description': fields.text('Description') |
|
|
'description': fields.text('Description') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
mgmtsystem_kpi_category() |
|
|
|
|
|
|
|
|
|
|
|
class mgmtsystem_kpi_threshold_range(osv.osv): |
|
|
|
|
|
|
|
|
class mgmtsystem_kpi_threshold_range(orm.Model): |
|
|
""" |
|
|
""" |
|
|
KPI Threshold Range |
|
|
KPI Threshold Range |
|
|
""" |
|
|
""" |
|
@ -157,9 +158,8 @@ class mgmtsystem_kpi_threshold_range(osv.osv): |
|
|
'valid': True, |
|
|
'valid': True, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
mgmtsystem_kpi_threshold_range() |
|
|
|
|
|
|
|
|
|
|
|
class mgmtsystem_kpi_threshold(osv.osv): |
|
|
|
|
|
|
|
|
class mgmtsystem_kpi_threshold(orm.Model): |
|
|
""" |
|
|
""" |
|
|
KPI Threshold |
|
|
KPI Threshold |
|
|
""" |
|
|
""" |
|
@ -236,9 +236,8 @@ class mgmtsystem_kpi_threshold(osv.osv): |
|
|
color = range_obj.color |
|
|
color = range_obj.color |
|
|
return color |
|
|
return color |
|
|
|
|
|
|
|
|
mgmtsystem_kpi_threshold() |
|
|
|
|
|
|
|
|
|
|
|
class mgmtsystem_kpi_history(osv.osv): |
|
|
|
|
|
|
|
|
class mgmtsystem_kpi_history(orm.Model): |
|
|
""" |
|
|
""" |
|
|
History of the KPI |
|
|
History of the KPI |
|
|
""" |
|
|
""" |
|
@ -263,9 +262,8 @@ class mgmtsystem_kpi_history(osv.osv): |
|
|
|
|
|
|
|
|
_order = "date desc" |
|
|
_order = "date desc" |
|
|
|
|
|
|
|
|
mgmtsystem_kpi_threshold() |
|
|
|
|
|
|
|
|
|
|
|
class mgmtsystem_kpi(osv.osv): |
|
|
|
|
|
|
|
|
class mgmtsystem_kpi(orm.Model): |
|
|
""" |
|
|
""" |
|
|
Key Performance Indicators |
|
|
Key Performance Indicators |
|
|
""" |
|
|
""" |
|
@ -381,6 +379,4 @@ class mgmtsystem_kpi(osv.osv): |
|
|
'periodicity_uom': 'day', |
|
|
'periodicity_uom': 'day', |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
mgmtsystem_kpi() |
|
|
|
|
|
|
|
|
|
|
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
|
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |