[IMP] fix project dashboard, removing bad reports, imp dashboard
bzr revid: fp@tinyerp.com-20120628163009-xeiz0xewhqzoimxl
This commit is contained in:
parent
864c95695b
commit
c15de911e5
|
@ -2,41 +2,6 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_project_vs_remaining_hours_tree" model="ir.ui.view">
|
||||
<field name="name">project.vs.remaining.hour.tree</field>
|
||||
<field name="model">project.vs.hours</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Remaining Hours Per Project" colors="pink:state=='draft';blue:state=='pending';black:state=='open';red:state=='cancelled';grey:state=='close';yellow:state=='template'">
|
||||
<field name="project"/>
|
||||
<field name="remaining_hours"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_project_vs_remaining_hours_graph" model="ir.ui.view">
|
||||
<field name="name">project.vs.remaining.hour.graph</field>
|
||||
<field name="model">project.vs.hours</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Project vs remaining hours" type="bar">
|
||||
<field name="project"/>
|
||||
<field name="state" group="True"/>
|
||||
<field name="remaining_hours" operator="+"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_project_vs_remaining_hours_graph" model="ir.actions.act_window">
|
||||
<field name="name">Remaining Hours Per Project</field>
|
||||
<field name="res_model">project.vs.hours</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
<field name="domain">[('user_id','=',uid),('state','not in',('cancel','done'))]</field>
|
||||
<field name="view_id" ref="view_project_vs_remaining_hours_graph"/>
|
||||
</record>
|
||||
|
||||
<record id="view_task_tree" model="ir.ui.view">
|
||||
<field name="name">project.task.tree</field>
|
||||
<field name="model">project.task</field>
|
||||
|
@ -74,10 +39,10 @@
|
|||
<form string="My Board" version="7.0">
|
||||
<board style="2-1">
|
||||
<column>
|
||||
<action name="%(my_open_tasks_action)d" string="My Tasks" creatable="true"/>
|
||||
<action name="%(my_open_tasks_action)d" string="My Tasks"/>
|
||||
</column>
|
||||
<column>
|
||||
<action name="%(action_project_vs_remaining_hours_graph)d" string="My Remaining Hours by Project"/>
|
||||
<action name="%(action_view_task_history_cumulative)d" string="Open Tasks"/>
|
||||
</column>
|
||||
</board>
|
||||
</form>
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
<field name="view_mode">graph,tree</field>
|
||||
<field name="view_id" ref="view_task_history_graph"/>
|
||||
<field eval="False" name="filter"/>
|
||||
<field name="context">{"search_default_open":1, "search_default_this_month": 1, "search_default_project_id": project_id}</field>
|
||||
<field name="context">{"search_default_open":1, "search_default_this_month": 1}</field>
|
||||
</record>
|
||||
<menuitem action="action_view_task_history_cumulative"
|
||||
id="menu_action_view_task_history_cumulative"
|
||||
|
|
|
@ -120,88 +120,3 @@ class report_project_task_user(osv.osv):
|
|||
|
||||
report_project_task_user()
|
||||
|
||||
#This class is generated for project deshboard purpose
|
||||
class project_vs_hours(osv.osv):
|
||||
_name = "project.vs.hours"
|
||||
_description = " Project vs hours"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'project': fields.char('Project', size=128, required=True),
|
||||
'remaining_hours': fields.float('Remaining Hours', readonly=True),
|
||||
'user_id': fields.many2one('res.users', 'Assigned To', readonly=True),
|
||||
'planned_hours': fields.float('Planned Hours', readonly=True),
|
||||
'total_hours': fields.float('Total Hours', readonly=True),
|
||||
'state': fields.selection([('draft','Draft'),('open','Open'), ('pending','Pending'),('cancelled', 'Cancelled'),('close','Close'),('template', 'Template')], 'Status', required=True, readonly=True)
|
||||
}
|
||||
_order = 'project desc'
|
||||
|
||||
def init(self, cr):
|
||||
tools.sql.drop_view_if_exists(cr, 'project_vs_hours')
|
||||
cr.execute("""
|
||||
CREATE or REPLACE view project_vs_hours as (
|
||||
select
|
||||
min(pt.id) as id,
|
||||
aaa.user_id as user_id,
|
||||
aaa.name as project,
|
||||
aaa.state,
|
||||
sum(pt.remaining_hours) as remaining_hours,
|
||||
sum(pt.planned_hours) as planned_hours,
|
||||
sum(pt.total_hours) as total_hours
|
||||
FROM project_project as pp,
|
||||
account_analytic_account as aaa,
|
||||
project_task as pt
|
||||
WHERE aaa.id=pp.analytic_account_id and pt.project_id=pp.id and pp.analytic_account_id=aaa.id
|
||||
GROUP BY aaa.user_id,aaa.state,aaa.name
|
||||
UNION All
|
||||
SELECT
|
||||
min(pt.id) as id,
|
||||
pur.uid as user_id,
|
||||
aaa.name as project,
|
||||
aaa.state,
|
||||
sum(pt.remaining_hours) as remaining_hours,
|
||||
sum(pt.planned_hours) as planned_hours,
|
||||
sum(pt.total_hours) as total_hours
|
||||
FROM project_project as pp,
|
||||
project_user_rel as pur,
|
||||
account_analytic_account as aaa,
|
||||
project_task as pt
|
||||
WHERE pur.project_id=pp.id and pt.project_id=pp.id and pp.analytic_account_id=aaa.id AND pur.uid != aaa.user_id
|
||||
GROUP BY pur.uid,aaa.state,aaa.name
|
||||
)
|
||||
""")
|
||||
|
||||
project_vs_hours()
|
||||
|
||||
class task_by_days(osv.osv):
|
||||
_name = "task.by.days"
|
||||
_description = "Task By Days"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'day': fields.char('Day', size=128, required=True),
|
||||
'state': fields.selection([('draft', 'Draft'),('open', 'In Progress'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'Status', readonly=True, required=True),
|
||||
'total_task': fields.float('Total tasks', readonly=True),
|
||||
'project_id':fields.many2one('project.project', 'Project')
|
||||
}
|
||||
_order = 'day desc'
|
||||
|
||||
def init(self, cr):
|
||||
tools.sql.drop_view_if_exists(cr, 'task_by_days')
|
||||
cr.execute("""
|
||||
CREATE or REPLACE view task_by_days as (
|
||||
SELECT
|
||||
min(pt.id) as id,
|
||||
to_char(pt.create_date, 'YYYY-MM-DD') as day,
|
||||
count(*) as total_task,
|
||||
pt.state as state,
|
||||
pt.project_id
|
||||
FROM
|
||||
project_task as pt
|
||||
GROUP BY
|
||||
to_char(pt.create_date, 'YYYY-MM-DD'),pt.state,pt.project_id
|
||||
)
|
||||
""")
|
||||
|
||||
task_by_days()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -5,8 +5,6 @@ access_project_task_type_user,project.task.type user,model_project_task_type,pro
|
|||
access_project_task,project.task,model_project_task,project.group_project_user,1,1,1,1
|
||||
access_project_task_work,project.task.work,model_project_task_work,project.group_project_user,1,1,1,1
|
||||
access_report_project_task_user,report.project.task.user,model_report_project_task_user,project.group_project_manager,1,1,1,1
|
||||
access_project_vs_hours,project.vs.hours,model_project_vs_hours,project.group_project_user,1,1,1,1
|
||||
access_task_by_days,task.by.days,model_task_by_days,project.group_project_user,1,1,1,1
|
||||
access_partner_task user,base.res.partner user,base.model_res_partner,project.group_project_user,1,0,0,0
|
||||
access_task_on_partner,project.task on partners,model_project_task,base.group_user,1,0,0,0
|
||||
access_project_on_partner,project.project on partners,model_project_project,base.group_user,1,0,0,0
|
||||
|
|
|
Loading…
Reference in New Issue