[IMP]:project:Improved task report.

bzr revid: apa@tinyerp.com-20100419124337-s5uspa7518akm2rb
This commit is contained in:
apa-tiny
2010-04-19 18:13:37 +05:30
parent c198064553
commit 5a355a14cc
2 changed files with 16 additions and 16 deletions
+5 -5
View File
@@ -40,7 +40,10 @@ class report_project_task_user(osv.osv):
'hours_planned': fields.float('Planned Hours', readonly=True),
'hours_effective': fields.float('Effective Hours', readonly=True),
'hours_delay': fields.float('Avg. Plan.-Eff.', readonly=True),
'closing_days': fields.char('Avg Closing Delay', size=64, readonly=True),
# 'closing_days': fields.char('Avg Closing Delay', size=64, readonly=True),
'closing_days': fields.float('Avg Closing Delay', digits=(16,2), readonly=True, group_operator="avg",
help="Number of Days to close the task"),
'nbr': fields.integer('#Number of tasks', readonly=True),
'priority' : fields.selection([('4','Very Low'),
('3','Low'),
@@ -58,7 +61,6 @@ class report_project_task_user(osv.osv):
('done', 'Done')],
'State', readonly=True),
'company_id': fields.many2one('res.company', 'Company',readonly=True),
'sprint_id': fields.many2one('scrum.sprint', 'Sprint',readonly=True),
'partner_id': fields.many2one('res.partner', 'Partner',readonly=True),
'type': fields.many2one('project.task.type', 'Stage',readonly=True),
@@ -80,7 +82,6 @@ class report_project_task_user(osv.osv):
sum(cast(to_char(date_trunc('day',t.date_end) - date_trunc('day',t.date_start),'DD') as int)) as no_of_days,
t.user_id,
t.project_id,
t.sprint_id as sprint_id,
t.state,
t.priority,
t.name,
@@ -88,7 +89,7 @@ class report_project_task_user(osv.osv):
t.partner_id,
t.type,
sum(planned_hours) as hours_planned,
to_char(avg(date_end::abstime-t.create_date::timestamp), 'DD"d" HH24:MI:SS') as closing_days,
avg(extract('epoch' from (t.date_end-t.create_date)))/(3600*24) as closing_days,
sum(w.hours) as hours_effective,
((sum(planned_hours)-sum(w.hours))/count(distinct t.id))::decimal(16,2) as hours_delay
from project_task t
@@ -106,7 +107,6 @@ class report_project_task_user(osv.osv):
t.partner_id,
t.type,
t.name,
t.sprint_id,
t.project_id,
t.date_start
)
+11 -11
View File
@@ -53,16 +53,16 @@
<search string="Tasks">
<group>
<filter icon="terp-project" string="This Year"
domain="[('date_start','&lt;=', time.strftime('%%Y-%%m-%%d')),('date_start','&gt;=',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
domain="[('date_start','&lt;=', time.strftime('%%Y-%%m-%%d')),('date_start','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="Tasks performed in this year"/>
<filter icon="terp-project" string="This Month"
name="month"
domain="[('date_start','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date_start','&gt;=',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
domain="[('date_start','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date_start','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
help="Tasks performed in this month"/>
<filter icon="gtk-media-rewind"
string=" 7 Days "
separator="1"
domain="[('date_start','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date_start','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
domain="[('date_start','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date_start','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Tasks during last 7 days"/>
<separator orientation="vertical"/>
<filter string="Draft"
@@ -100,30 +100,30 @@
</field>
</group>
<newline/>
<group expand="1" string="Extended options..." colspan="10" col="12">
<filter string="Done"
<group string="Extended options..." colspan="10" col="12">
<filter string="Done"
icon="terp-project"
name="done"
domain="[('state','=','done')]"/>
<filter string="Cancelled"
icon="terp-project"
domain="[('state','=','cancelled')]"/>
<separator orientation="vertical"/>
<field name="type" widget="selection"/>
<field name="priority"/>
<field name="partner_id" widget="selection"/>
<separator orientation="vertical"/>
<field name="date_deadline"/>
<field name="partner_id"/>
<field name="sprint_id" widget="selection"/>
<newline/>
<field name="date_start"/>
<field name="date_end"/>
</group>
<newline/>
<group string="Group By..." colspan="10" col="11">
<filter string="User" icon="terp-project" context="{'group_by':'user_id'}" />
<group expand="1" string="Group By..." colspan="10" col="11">
<filter string="User" name="User" icon="terp-project" context="{'group_by':'user_id'}" />
<filter string="Project" icon="terp-project" context="{'group_by':'project_id'}"/>
<filter string="Partner" icon="terp-project" context="{'group_by':'partner_id'}" />
<separator orientation="vertical"/>
<filter string="Sprint" icon="terp-project" context="{'group_by':'sprint_id'}"/>
<filter string="State" icon="terp-project" context="{'group_by':'state'}"/>
<filter string="Company" icon="terp-project" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<filter string="Stage" icon="terp-project" context="{'group_by':'type'}" />
@@ -142,7 +142,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="search_view_id" ref="view_task_project_user_search"/>
<field name="context">{'search_default_month':1,'search_default_user_id':uid}</field>
<field name="context">{'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}</field>
</record>
<menuitem action="action_project_task_user_tree" id="menu_project_task_user_tree" parent="base.menu_project_report"/>