From ebf3b965270287c284eebcf230181952a213ef97 Mon Sep 17 00:00:00 2001 From: "Rvo (Open ERP)" Date: Tue, 12 Jan 2010 18:15:02 +0530 Subject: [PATCH] [ADD]:added module project_long_term bzr revid: rvo@tinyerp.co.in-20100112124502-k2adb24jmfixtngm --- addons/project_long_term/__init__.py | 25 ++ addons/project_long_term/__terp__.py | 42 +++ addons/project_long_term/project.py | 119 +++++++++ addons/project_long_term/project_data.xml | 16 ++ .../project_data_scheduler.xml | 23 ++ addons/project_long_term/project_demo.xml | 252 ++++++++++++++++++ addons/project_long_term/project_report.xml | 8 + addons/project_long_term/project_view.xml | 101 +++++++ addons/project_long_term/project_wizard.xml | 8 + 9 files changed, 594 insertions(+) create mode 100644 addons/project_long_term/__init__.py create mode 100644 addons/project_long_term/__terp__.py create mode 100644 addons/project_long_term/project.py create mode 100644 addons/project_long_term/project_data.xml create mode 100644 addons/project_long_term/project_data_scheduler.xml create mode 100644 addons/project_long_term/project_demo.xml create mode 100644 addons/project_long_term/project_report.xml create mode 100644 addons/project_long_term/project_view.xml create mode 100644 addons/project_long_term/project_wizard.xml diff --git a/addons/project_long_term/__init__.py b/addons/project_long_term/__init__.py new file mode 100644 index 00000000000..33adeb520b9 --- /dev/null +++ b/addons/project_long_term/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +import project + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/project_long_term/__terp__.py b/addons/project_long_term/__terp__.py new file mode 100644 index 00000000000..1b5dfa348ad --- /dev/null +++ b/addons/project_long_term/__terp__.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + + +{ + "name" : "Long Term Project Management", + "version": "1.1", + "author" : "Tiny", + "website" : "http://www.openerp.com", + "category" : "Generic Modules/Projects & Services", + "depends" : ["project"], + "description": """Long Term Project management module that track planning, scheduling, resources allocation. + """, + "init_xml" : [], + "demo_xml" : [#"project_demo.xml" +], + "update_xml": [ + "project_view.xml", + ], + 'installable': True, + 'active': False, + 'certificate': None, +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/project_long_term/project.py b/addons/project_long_term/project.py new file mode 100644 index 00000000000..f04e18babfd --- /dev/null +++ b/addons/project_long_term/project.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from lxml import etree +from mx import DateTime +from mx.DateTime import now +import time +from tools.translate import _ + +from osv import fields, osv +from tools.translate import _ + +class project_phase(osv.osv): + _name = "project.phase" + _description = "Project Phase" + + def _check_recursion(self,cr,uid,ids): + level = 100 + while len(ids): + cr.execute('select distinct next_phase_id from project_phase_next_rel where phase_id in ('+','.join(map(str, ids))+')') + ids = filter(None, map(lambda x:x[0], cr.fetchall())) + next_ids = ids + while(next_ids): + cr.execute('select distinct prev_phase_id from project_phase_prev_rel where phase_id in ('+','.join(map(str, ids))+')') + prev_ids = filter(None, map(lambda x:x[0], cr.fetchall())) + + return True + + while(ids): + cr.execute('select distinct child_id from account_account_consol_rel where parent_id in ('+','.join(map(str, ids))+')') + child_ids = filter(None, map(lambda x: x[0], cr.fetchall())) + c_ids = child_ids + if (p_id and (p_id in c_ids)) or (obj_self.id in c_ids): + return False + while len(c_ids): + s_ids = self.search(cr, uid, [('parent_id', 'in', c_ids)]) + if p_id and (p_id in s_ids): + return False + c_ids = s_ids + ids = child_ids + return True + + + + _columns = { + 'name': fields.char("Phase Name", size=64, required=True), + 'date_start': fields.datetime('Starting Date'), + 'date_end': fields.datetime('End Date'), + 'constraint_date_start': fields.datetime('Constraint Starting Date'), + 'constraint_date_end': fields.datetime('Constraint End Date'), + 'project_id': fields.many2one('project.project', 'Project', required=True), + 'next_phase_ids': fields.many2many('project.phase', 'project_phase_next_rel', 'phase_id', 'next_phase_id', 'Next Phases'), + 'previous_phase_ids': fields.many2many('project.phase', 'project_phase_previous_rel', 'phase_id', 'prv_phase_id', 'Previous Phases'), + 'duration': fields.float('Duration'), + 'product_uom': fields.many2one('product.uom', 'Duration UoM', help="UoM (Unit of Measure) is the unit of measurement for Duration"), + 'task_ids': fields.one2many('project.task', 'phase_id', "Project Tasks"), + 'resource_ids': fields.one2many('project.resource.allocation', 'phase_id', "Project Resources"), + } + + _defaults = { + 'date_start': lambda *a: time.strftime('%Y-%m-%d'), + } + + _order = "name" + _constraints = [ + (_check_recursion,'Error ! Loops In Phases Not Allowed',['next_phase_ids','previous_phase_ids']) + ] +project_phase() + +class project_resource_allocation(osv.osv): + _name = 'project.resource.allocation' + _description = 'Project Resource Allocation' + _columns = { + 'resource_id': fields.many2one('resource.resource', 'Resource', required=True), + 'phase_id': fields.many2one('project.phase', 'Project Phase', required=True), + 'useability': fields.float('Useability', help="Useability of this ressource for this project phase in percentage (=50%)"), + } + _defaults = { + 'useability': lambda *a: 100, + } +project_resource_allocation() + +class project(osv.osv): + _inherit = "project.project" + + _columns = { + 'phase_ids': fields.one2many('project.phase', 'project_id', "Project Phases") + } + +project() + +class task(osv.osv): + _inherit = "project.task" + + _columns = { + 'phase_id': fields.many2one('project.phase', 'Project Phase') + } + +task() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/project_long_term/project_data.xml b/addons/project_long_term/project_data.xml new file mode 100644 index 00000000000..2addd68fa19 --- /dev/null +++ b/addons/project_long_term/project_data.xml @@ -0,0 +1,16 @@ + + + + + + Project + project.project + + + Project task + project.task + + + diff --git a/addons/project_long_term/project_data_scheduler.xml b/addons/project_long_term/project_data_scheduler.xml new file mode 100644 index 00000000000..32e74725d58 --- /dev/null +++ b/addons/project_long_term/project_data_scheduler.xml @@ -0,0 +1,23 @@ + + + + + + + Calculate Project Task Length Scheduler + + + 1 + minutes + -1 + + + + + + + + + + diff --git a/addons/project_long_term/project_demo.xml b/addons/project_long_term/project_demo.xml new file mode 100644 index 00000000000..e762d3874ba --- /dev/null +++ b/addons/project_long_term/project_demo.xml @@ -0,0 +1,252 @@ + + + + + + + + + + + Analysis + + + New Feature + + + Quotation + + + Bug + + + + 1 + Open ERP Integration + + + + 1 + 10 + + Study + Prototype + + + + + 20 + + Specific Developements + + + + + 30 + + Install, data import, configuration + + + + + + 38.0 + 38.0 + + + + BoM, After sales returns, interventions. Tracability. + Specific adaptation to MRP + + + 16.0 + 16.0 + + + + Data importation + Doc + + + 16.0 + 16.0 + + + + Modifications asked by the customer. + + + 16.0 + 16.0 + + + 0 + + Customer analysis + Architecture + + + 15 + 8.0 + 8.0 + + + + Internal testing + Software Install + 2008-06-06 + + + 17 + 16.0 + 16.0 + + + 2 + open + + Analysis, Data Importation + + + 20 + 16.0 + 16.0 + open + + + Parameters + + + 20 + 32.0 + 32.0 + + open + + Start of the doc redaction + MRP + + + 25 + 24.0 + 24.0 + + + done + MRP Tests + + + 29 + 24.0 + 24.0 + + + MRP; functionnal layer + done + + + + 30 + 24.0 + 24.0 + + + Products Adaptation + + + 30 + 24.0 + 24.0 + + + Install + Super User Training + + + 30 + 32.0 + 32.0 + + + Customer docs + + + 30 + 24.0 + 24.0 + + + Development of the presentation layer + + + 40 + 32.0 + 32.0 + + + Free Time + + + 40 + 50.0 + 50.0 + + + Specific tests + + + 40 + 24.0 + 24.0 + + + Sale module + + + 40 + 32.0 + 32.0 + + + open + In house training + 2007-06-06 + + + 50 + 24.0 + 24.0 + + + Validation + latest modifications. + + + 50 + 24.0 + 24.0 + + + Adaptations buy module + + + 60 + 16.0 + 16.0 + + + Presentation of the software. + + + 60 + 24.0 + 24.0 + + + Adaptations Stock module + + + 70 + 24.0 + 24.0 + + + Latest in house tests + + + diff --git a/addons/project_long_term/project_report.xml b/addons/project_long_term/project_report.xml new file mode 100644 index 00000000000..c3b681cdd8b --- /dev/null +++ b/addons/project_long_term/project_report.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/addons/project_long_term/project_view.xml b/addons/project_long_term/project_view.xml new file mode 100644 index 00000000000..5afbad59af8 --- /dev/null +++ b/addons/project_long_term/project_view.xml @@ -0,0 +1,101 @@ + + + + + project.resource.allocation.form + project.resource.allocation + form + +
+ + + + + +
+ + project.resource.allocation.list + project.resource.allocation + tree + + + + + + + + + + + project.phase.form + project.phase + form + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + project.phase.list + project.phase + tree + + + + + + + + + + + + + + + + Project phases + project.phase + form + + + + + + + +
+
diff --git a/addons/project_long_term/project_wizard.xml b/addons/project_long_term/project_wizard.xml new file mode 100644 index 00000000000..109a003da4a --- /dev/null +++ b/addons/project_long_term/project_wizard.xml @@ -0,0 +1,8 @@ + + + + + + + +