New module report_task:

To track pipelines of users

bzr revid: fp@tinyerp.com-096a38e38ac642f11e4c560e04aa720f1cfb1900
This commit is contained in:
Fabien Pinckaers 2007-04-17 06:55:13 +00:00
parent 1f039da422
commit e653d75d2c
4 changed files with 162 additions and 0 deletions

View File

@ -0,0 +1,6 @@
#####################################################################
#Created By : Eiffel Consultancy Pvt. Ltd.
#Created Date : 14/02/2007
#####################################################################
import report_task

View File

@ -0,0 +1,22 @@
#####################################################################
#Created By : Eiffel Consultancy Pvt. Ltd.
#Created Date : 14/02/2007
#####################################################################
{
'name' : 'Report on tasks by user for projects',
'version' :'1.0',
'author' : 'Tiny',
'depends' : ['base','project'],
'description': 'Gives statistics on tasks by user on projects to check the pipeline of users.',
'init_xml' : [],
'update_xml': [
'report_task_view.xml',
],
'active': True,
'installable': True
}

View File

@ -0,0 +1,65 @@
##############################################################################
#
# Copyright (c) 2004-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
#
# $Id: project.py 1005 2005-07-25 08:41:42Z nicoe $
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# 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 2
# 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, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from osv import fields,osv
class report_task_user_pipeline_open (osv.osv):
_name = "report.task.user.pipeline.open"
_description = "Tasks by user and project"
_auto = False
_columns = {
'user_id':fields.many2one('res.users', 'User', readonly=True, relate=True),
'task_nbr': fields.float('Task Number', readonly=True),
'task_hrs': fields.float('Task Hours', readonly=True),
'task_progress': fields.float('Task Progress', readonly=True),
'company_id' : fields.many2one('res.company', 'Company'),
'task_state' : fields.char('Task State',size = '64' ,readonly=True),
}
def init(self, cr):
cr.execute("""
create or replace view report_task_user_pipeline_open as (
select
u.id as id,
u.id as user_id,
u.company_id as company_id,
count(*) as task_nbr,
sum(planned_hours) as task_hrs,
sum(planned_hours*(100-progress)/100) as task_progress,
t.state as task_state
from
res_users u
full outer join project_task t on (u.id=t.user_id)
group by
u.id,u.company_id,t.state
)
""")
report_task_user_pipeline_open()

View File

@ -0,0 +1,69 @@
<?xml version="1.0"?>
<terp>
<data>
#
# Tasks by projects and users
#
<record model="ir.ui.view" id="view_task_project_form">
<field name="name">report.project.task.form</field>
<field name="model">report.task.user.pipeline.open</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Tasks by Project ">
<field name="user_id" select="1"/>
<field name="company_id" select="1"/>
<field name="task_nbr" select="1"/>
<field name="task_hrs" select="1"/>
<field name="task_progress" select="1"/>
<field name="task_state" select="1"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_task_project_tree">
<field name="name">report.project.task.tree</field>
<field name="model">report.task.user.pipeline.open</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Tasks by projects ">
<field name="user_id" select="1"/>
<field name="company_id" select="1"/>
<field name="task_nbr" select="1"/>
<field name="task_hrs" select="1"/>
<field name="task_progress" select="1"/>
<field name="task_state" select="1"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_project_task">
<field name="name">report.project.task.tree</field>
<field name="res_model">report.task.user.pipeline.open</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[]</field>
</record>
<menuitem name="Project/Reporting/All Months/User's tasks" action="action_project_task" id="menu_project_task_user_tree"/>
<record model="ir.actions.act_window" id="action_project_task_done">
<field name="name">report.project.task.tree</field>
<field name="res_model">report.task.user.pipeline.open</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('task_state','=','done')]</field>
</record>
<menuitem name="Project/Reporting/All Months/User's tasks/User's close task" action="action_project_task_done" id="menu_project_task_user_tree2"/>
<record model="ir.actions.act_window" id="action_project_task_open">
<field name="name">report.project.task.tree</field>
<field name="res_model">report.task.user.pipeline.open</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('task_state','=','open')]</field>
</record>
<menuitem name="Project/Reporting/All Months/User's tasks/User's open task" action="action_project_task_open" id="menu_project_task_user_tree3"/>
</data>
</terp>