[IMP]: Improved project dashboard.
bzr revid: jni@tinyerp.com-20100713120301-zbn0v36ofcyhwwvp
This commit is contained in:
parent
1263dd94ae
commit
4266b285c3
|
@ -23,7 +23,7 @@
|
|||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="action_view_task_tree" model="ir.actions.act_window">
|
||||
<field name="name">My Open Tasks</field>
|
||||
<field name="res_model">project.task</field>
|
||||
|
@ -32,16 +32,16 @@
|
|||
<field name="domain">[('user_id','=',uid),('state','=','open')]</field>
|
||||
<field name="view_id" ref="view_task_tree"/>
|
||||
</record>
|
||||
|
||||
<record id="action_view_pending_task_tree" model="ir.actions.act_window">
|
||||
<field name="name">My Pending Tasks</field>
|
||||
|
||||
<record id="action_view_delegate_task_tree" model="ir.actions.act_window">
|
||||
<field name="name">My Delegated Tasks</field>
|
||||
<field name="res_model">project.task</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('user_id','=',uid),('state','=','pending')]</field>
|
||||
<field name="view_id" ref="view_task_tree"/>
|
||||
<field name="domain">['|',('parent_ids.user_id','=',uid),('user_id','=',uid)]</field>
|
||||
<field name="view_id" ref="project.view_task_tree2"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="action_view_task_tree_deadline" model="ir.actions.act_window">
|
||||
<field name="name">My Task's Deadlines</field>
|
||||
<field name="res_model">project.task</field>
|
||||
|
@ -87,7 +87,7 @@
|
|||
<hpaned>
|
||||
<child1>
|
||||
<action colspan="4" name="%(action_view_task_tree)d" string="My Open Tasks" width="510"/>
|
||||
<action colspan="4" name="%(action_view_pending_task_tree)d" string="My Pending Tasks" width="510"/>
|
||||
<action colspan="4" name="%(action_view_delegate_task_tree)d" string="My Delegated Tasks" width="510"/>
|
||||
</child1>
|
||||
<child2>
|
||||
<vpaned>
|
||||
|
@ -95,7 +95,7 @@
|
|||
<action colspan="4" name="%(project.action_project_vs_remaining_hours_graph)d" string="Remaining Hours Per Project" />
|
||||
</child1>
|
||||
<child2>
|
||||
<action colspan="4" name="%(project.action_task_by_days_vs_planned_hours_graph)d" string="Planned Hours Per Day" />
|
||||
<action colspan="4" name="%(project.action_project_vs_planned_total_hours_graph)d" string="My Projects: Planned Vs Total Hours" />
|
||||
</child2>
|
||||
</vpaned>
|
||||
</child2>
|
||||
|
@ -112,20 +112,20 @@
|
|||
<field name="usage">menu</field>
|
||||
<field name="view_id" ref="board_project_form"/>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
id="next_id_86"
|
||||
name="Dashboard"
|
||||
icon="terp-graph"
|
||||
sequence="0"
|
||||
parent="base.menu_project_report"/>
|
||||
|
||||
|
||||
<menuitem
|
||||
action="open_board_project"
|
||||
icon="terp-graph"
|
||||
id="menu_board_project"
|
||||
parent="next_id_86"
|
||||
sequence="1"/>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -122,27 +122,31 @@ class report_project_task_user(osv.osv):
|
|||
report_project_task_user()
|
||||
|
||||
#This class is generated for project deshboard purpose
|
||||
class project_vs_remaining_hours(osv.osv):
|
||||
_name = "project.vs.remaining.hours"
|
||||
_description = " Project vs Remaining hours"
|
||||
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),
|
||||
'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')], 'State', required=True, readonly=True)
|
||||
}
|
||||
_order = 'project desc'
|
||||
|
||||
def init(self, cr):
|
||||
tools.sql.drop_view_if_exists(cr, 'project_vs_remaining_hours')
|
||||
tools.sql.drop_view_if_exists(cr, 'project_vs_hours')
|
||||
cr.execute("""
|
||||
CREATE or REPLACE view project_vs_remaining_hours as (
|
||||
CREATE or REPLACE view project_vs_hours as (
|
||||
select
|
||||
min(pt.id) as id,
|
||||
aaa.user_id as uid,
|
||||
aaa.name as project,
|
||||
aaa.state,
|
||||
sum(pt.remaining_hours) as remaining_hours
|
||||
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
|
||||
|
@ -154,7 +158,9 @@ class project_vs_remaining_hours(osv.osv):
|
|||
pur.uid as uid,
|
||||
aaa.name as project,
|
||||
aaa.state,
|
||||
sum(pt.remaining_hours) as remaining_hours
|
||||
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,
|
||||
|
@ -164,7 +170,7 @@ class project_vs_remaining_hours(osv.osv):
|
|||
)
|
||||
""")
|
||||
|
||||
project_vs_remaining_hours()
|
||||
project_vs_hours()
|
||||
|
||||
class task_by_days(osv.osv):
|
||||
_name = "task.by.days"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
|
||||
<menuitem id="base.menu_project_report" name="Reporting" parent="base.menu_main_pm" sequence="50"/>
|
||||
|
||||
<record id="view_task_project_user_tree" model="ir.ui.view">
|
||||
|
@ -91,7 +91,7 @@
|
|||
<field name="project_id">
|
||||
<filter icon="terp-folder-blue"
|
||||
string="My Projects"
|
||||
help="My Projects" domain="[('project_id','=',uid)]"/>
|
||||
help="My Projects" domain="[('project_id','=',uid)]"/>
|
||||
</field>
|
||||
|
||||
<field name="user_id" widget="selection">
|
||||
|
@ -151,7 +151,7 @@
|
|||
<!-- Views and action for project dashboard -->
|
||||
<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.remaining.hours</field>
|
||||
<field name="model">project.vs.hours</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Project and remaining hours" colors="pink:state=='draft';blue:state=='pending';black:state=='open';red:state=='cancelled';grey:state=='close';yellow:state=='template'">
|
||||
|
@ -164,7 +164,7 @@
|
|||
|
||||
<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.remaining.hours</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">
|
||||
|
@ -177,13 +177,25 @@
|
|||
|
||||
<record id="action_project_vs_remaining_hours_graph" model="ir.actions.act_window">
|
||||
<field name="name">Project and remaining hours</field>
|
||||
<field name="res_model">project.vs.remaining.hours</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">[('uid','=',uid)]</field>
|
||||
<field name="domain">[('uid','=',uid),('state','=','open')]</field>
|
||||
<field name="view_id" ref="view_project_vs_remaining_hours_graph"/>
|
||||
</record>
|
||||
|
||||
<record id="open_view_project_vs_remaining_hours_tree" model="ir.actions.act_window.view">
|
||||
<field eval="1" name="sequence"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="view_project_vs_remaining_hours_tree"/>
|
||||
<field name="act_window_id" ref="action_project_vs_remaining_hours_graph"/>
|
||||
</record>
|
||||
<record id="open_view_project_vs_remaining_hours_graph" model="ir.actions.act_window.view">
|
||||
<field eval="2" name="sequence"/>
|
||||
<field name="view_mode">graph</field>
|
||||
<field name="view_id" ref="view_project_vs_remaining_hours_graph"/>
|
||||
<field name="act_window_id" ref="action_project_vs_remaining_hours_graph"/>
|
||||
</record>
|
||||
<!-- Views and action for project issue dashboard -->
|
||||
<record id="view_task_by_days_tree" model="ir.ui.view">
|
||||
<field name="name">task.by.days.tree</field>
|
||||
|
@ -222,38 +234,51 @@
|
|||
</record>
|
||||
|
||||
<!-- Views and action for project dashboard -->
|
||||
<record id="view_task_by_days_vs_planned_hours_tree" model="ir.ui.view">
|
||||
<field name="name">task.by.days.vs.planned.hours.tree</field>
|
||||
<field name="model">report.project.task.user</field>
|
||||
<record id="view_project_vs_planned_total_hours_tree" model="ir.ui.view">
|
||||
<field name="name">project.vs.planned.total.hour.tree</field>
|
||||
<field name="model">project.vs.hours</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Task By Days vs Planned Hours" >
|
||||
<field name="day"/>
|
||||
<field name="hours_planned"/>
|
||||
<tree string="Project Vs Planned and Total Hours" colors="pink:state=='draft';blue:state=='pending';black:state=='open';red:state=='cancelled';grey:state=='close';yellow:state=='template'">
|
||||
<field name="project"/>
|
||||
<field name="planned_hours"/>
|
||||
<field name="total_hours"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_task_by_days_vs_planned_hours_graph" model="ir.ui.view">
|
||||
<field name="name">task.by.days.vs.planned.hours.graph</field>
|
||||
<field name="model">report.project.task.user</field>
|
||||
<record id="view_project_vs_planned_total_hours_graph" model="ir.ui.view">
|
||||
<field name="name">project.vs.planned.total.hour.graph</field>
|
||||
<field name="model">project.vs.hours</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Task By Days vs Planned Hours" type="bar">
|
||||
<field name="day"/>
|
||||
<field name="hours_planned" operator="+"/>
|
||||
<field name="project_id" group="True"/>
|
||||
<graph string="Project Vs Planned and Total Hours" type="bar">
|
||||
<field name="project"/>
|
||||
<field name="planned_hours" operator="+"/>
|
||||
<field name="total_hours" operator="+"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_task_by_days_vs_planned_hours_graph" model="ir.actions.act_window">
|
||||
<field name="name">Task By Days vs Planned Hours</field>
|
||||
<field name="res_model">report.project.task.user</field>
|
||||
<record id="action_project_vs_planned_total_hours_graph" model="ir.actions.act_window">
|
||||
<field name="name">My projects: Planned Vs Total hours</field>
|
||||
<field name="res_model">project.vs.hours</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
<field name="view_id" ref="view_task_by_days_vs_planned_hours_graph"/>
|
||||
<field name="view_id" ref="view_project_vs_planned_total_hours_graph"/>
|
||||
</record>
|
||||
|
||||
<record id="open_view_project_vs_planned_total_hours_tree" model="ir.actions.act_window.view">
|
||||
<field eval="1" name="sequence"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="view_project_vs_planned_total_hours_tree"/>
|
||||
<field name="act_window_id" ref="action_project_vs_planned_total_hours_graph"/>
|
||||
</record>
|
||||
<record id="open_view_project_vs_planned_total_hours_graph" model="ir.actions.act_window.view">
|
||||
<field eval="2" name="sequence"/>
|
||||
<field name="view_mode">graph</field>
|
||||
<field name="view_id" ref="view_project_vs_planned_total_hours_graph"/>
|
||||
<field name="act_window_id" ref="action_project_vs_planned_total_hours_graph"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
"access_project_task_work_manager","project.task.work.manager","model_project_task_work","project.group_project_manager",1,1,1,1
|
||||
"access_project_message","project.message","model_project_message","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,0,0,0
|
||||
"access_project_vs_remaining_hours","project.vs.remaining.hours","model_project_vs_remaining_hours","project.group_project_user",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_partner_task manager","base.res.partner manager","base.model_res_partner","project.group_project_manager",1,0,0,0
|
||||
|
|
|
Loading…
Reference in New Issue