From dddea1b77645faf9cf8c59cd00ede4384c8336e4 Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Thu, 12 Apr 2012 13:40:52 +0200 Subject: [PATCH] [ADD] mgmtsystem_kpi --- mgmtsystem_kpi/__init__.py | 22 ++++ mgmtsystem_kpi/__openerp__.py | 43 ++++++++ mgmtsystem_kpi/mgmtsystem_kpi.py | 98 +++++++++++++++++ mgmtsystem_kpi/mgmtsystem_kpi.xml | 174 ++++++++++++++++++++++++++++++ 4 files changed, 337 insertions(+) create mode 100755 mgmtsystem_kpi/__init__.py create mode 100755 mgmtsystem_kpi/__openerp__.py create mode 100644 mgmtsystem_kpi/mgmtsystem_kpi.py create mode 100644 mgmtsystem_kpi/mgmtsystem_kpi.xml diff --git a/mgmtsystem_kpi/__init__.py b/mgmtsystem_kpi/__init__.py new file mode 100755 index 000000000..e8abd7249 --- /dev/null +++ b/mgmtsystem_kpi/__init__.py @@ -0,0 +1,22 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2012 Savoir-faire Linux (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## +import mgmtsystem_kpi +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/mgmtsystem_kpi/__openerp__.py b/mgmtsystem_kpi/__openerp__.py new file mode 100755 index 000000000..6df182a03 --- /dev/null +++ b/mgmtsystem_kpi/__openerp__.py @@ -0,0 +1,43 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2012 Savoir-faire Linux (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## +{ + "name" : "Key Performance Indicator", + "version" : "0.1", + "author" : "Savoir-faire Linux", + "website" : "http://www.savoirfairelinux.com", + "license" : "GPL-3", + "category" : "Management System", + "complexity" : "normal", + "description": """ + This module provides the basis for creating key performance indicators, + including static and dynamic thresholds. + """, + "depends" : ['mgmtsystem'], + "init_xml" : [], + "update_xml" : [ + 'mgmtsystem_kpi.xml', + ], + "demo_xml" : [], + "installable" : True, + "certificate" : '' +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/mgmtsystem_kpi/mgmtsystem_kpi.py b/mgmtsystem_kpi/mgmtsystem_kpi.py new file mode 100644 index 000000000..aa2a422e3 --- /dev/null +++ b/mgmtsystem_kpi/mgmtsystem_kpi.py @@ -0,0 +1,98 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2012 Savoir-faire Linux (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import fields, osv + +class mgmtsystem_kpi_category(osv.osv): + """ + KPI Category + """ + _name = "mgmtsystem.kpi.category" + _description = "KPI Category" + _columns = { + 'name': fields.char('Name', size=50, required=True), + 'description': fields.text('Description') + } + +mgmtsystem_kpi_category() + +class mgmtsystem_kpi_threshold_range(osv.osv): + """ + KPI Threshold Range + """ + _name = "mgmtsystem.kpi.threshold.range" + _description = "KPI Threshold Range" + + _columns = { + 'name': fields.char('Name', size=50, required=True), + 'min': fields.float('Minimum', required=True), + 'max': fields.float('Maximum', size=50, required=True), + 'color': fields.char('Color (RGB code)', size=7, required=True), + } + +mgmtsystem_kpi_threshold_range() + +class mgmtsystem_kpi_threshold(osv.osv): + """ + KPI Threshold + """ + _name = "mgmtsystem.kpi.threshold" + _description = "KPI Threshold" + + _columns = { + 'name': fields.char('Name', size=50, required=True), + 'range_ids': fields.many2many('mgmtsystem.kpi.threshold.range','mgmtsystem_kpi_threshold_range_rel', 'threshold_id', 'range_id', 'Range', required=True), + } + +mgmtsystem_kpi_threshold() + +class mgmtsystem_kpi_periodicity_uom(osv.osv): + """ + Unit of Measure for Periodicity + """ + _name = "mgmtsystem.kpi.periodicity.uom" + _description = "Periodicity Unit of Measure" + + _columns = { + 'name': fields.char('Name', size=10, required=True), + } + +mgmtsystem_kpi_threshold() + +class mgmtsystem_kpi(osv.osv): + """ + Key Performance Indicators + """ + _name = "mgmtsystem.kpi" + _description = "Key Performance Indicator" + _columns = { + 'name': fields.char('Name', size=50, required=True), + 'description': fields.text('Description'), + 'category_id': fields.many2one('mgmtsystem.kpi.category','Category', required=True), + 'threshold_id': fields.many2one('mgmtsystem.kpi.threshold','Threshold', required=True), + 'periodicity': fields.integer('Periodicity'), + 'periodicity_uom': fields.many2one('mgmtsystem.kpi.periodicity.uom','Periodicity UoM', required=True), + 'value': fields.float('Value'), + } + +mgmtsystem_kpi() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/mgmtsystem_kpi/mgmtsystem_kpi.xml b/mgmtsystem_kpi/mgmtsystem_kpi.xml new file mode 100644 index 000000000..207a56d8c --- /dev/null +++ b/mgmtsystem_kpi/mgmtsystem_kpi.xml @@ -0,0 +1,174 @@ + + + + + + + + mgmtsystem.kpi.tree + mgmtsystem.kpi + tree + + + + + + + + + + + + mgmtsystem.kpi.form + mgmtsystem.kpi + form + +
+ + + + + + + + + + + + +
+ + + + + Key Performance Indicators + mgmtsystem.kpi + form + tree,form + + + + + + + mgmtsystem.kpi.threshold.tree + mgmtsystem.kpi.threshold + tree + + + + + + + + + mgmtsystem.kpi.threshold.form + mgmtsystem.kpi.threshold + form + +
+ + + + + + + + + +
+
+ + + + + + + Thresholds + mgmtsystem.kpi.threshold + form + tree,form + + + + + + + mgmtsystem.kpi.threshold.range.tree + mgmtsystem.kpi.threshold.range + tree + + + + + + + + + + + + mgmtsystem.kpi.threshold.range.form + mgmtsystem.kpi.threshold.range + form + +
+ + + + + + + + +
+ + + + + Ranges + mgmtsystem.kpi.threshold.range + form + tree,form + + + + + + + Hour + + + + Day + + + + Week + + + + Month + + +
+