[IMP]
[odoo/odoo.git] / addons / project_timesheet / report / task_report_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3  <data>
4           <menuitem
5             id="hr.menu_hr_reporting"
6             name="Human Resources"
7             parent="base.menu_reporting"
8             sequence="40" />
9
10         <!-- Report for Users' Timesheet and Task Hours per Month -->
11
12                 <record id="view_report_timesheet_task_user_tree" model="ir.ui.view">
13             <field name="name">report.timesheet.task.user.tree</field>
14             <field name="model">report.timesheet.task.user</field>
15             <field name="type">tree</field>
16             <field name="arch" type="xml">
17                 <tree string="Timesheet/Task hours Report Per Month" >
18                     <field name="name" select="1"/>
19                     <field name="year" select="1" invisible="1"/>
20                     <field name="month" select="1" invisible="1"/>
21                     <field name="user_id" select="1"/>
22                     <field name="timesheet_hrs" widget="float_time" />
23                     <field name="task_hrs"  widget="float_time"/>
24                 </tree>
25             </field>
26         </record>
27       <record id="view_report_timesheet_task_user_search" model="ir.ui.view">
28             <field name="name">report.timesheet.task.user.search</field>
29             <field name="model">report.timesheet.task.user</field>
30             <field name="type">search</field>
31             <field name="arch" type="xml">
32                 <search string="Tasks by User">
33                         <group>
34                         <filter icon="terp-go-year" string="Year"
35                             name="year"
36                             domain="[('name','&lt;=', time.strftime('%%Y-%%m-%%d')),('name','&gt;=',time.strftime('%%Y-01-01'))]"
37                             help="Task Hours in current year"/>
38                         <separator orientation="vertical"/>
39                         <filter icon="terp-go-month" string="Month"
40                             name="month"
41                             domain="[('name','&lt;=',(datetime.date.today()+relativedelta(day=31)).strftime('%%Y-%%m-%%d')),('name','&gt;=',(datetime.date.today()-relativedelta(day=1)).strftime('%%Y-%%m-%%d'))]"
42                             help="Task Hours in current month"/>
43                         <filter icon="terp-go-month"
44                             string=" Month-1 "
45                             domain="[('name','&lt;=', (datetime.date.today() - relativedelta(day=31, months=1)).strftime('%%Y-%%m-%%d')),('name','&gt;=',(datetime.date.today() - relativedelta(day=1,months=1)).strftime('%%Y-%%m-%%d'))]"
46                             help="Task hours of last month"/>
47                                 <separator orientation="vertical"/>
48                             <field name="user_id"/>
49                         </group>
50                         <newline/>
51                         <group expand="1" string="Group By...">
52                             <filter string="User" name="group_user_id" icon="terp-personal" context="{'group_by':'user_id'}"/>
53                         <separator orientation="vertical"/>
54                         <filter string="Month" icon="terp-go-month" context="{'group_by':'month'}" help="Group by month of date"/>
55                         <filter string="Year" icon="terp-go-year" context="{'group_by':'year'}" help="Group by year of date"/>
56                     </group>
57
58                 </search>
59             </field>
60         </record>
61
62         <record id="view_task_hour_per_month_graph" model="ir.ui.view">
63             <field name="name">report.timesheet.task.user.graph</field>
64             <field name="model">report.timesheet.task.user</field>
65             <field name="type">graph</field>
66             <field name="arch" type="xml">
67                 <graph string="Task Hours Per Month" type="bar">
68                      <field name="user_id"/>
69                      <field name="task_hrs" operator="+"/>
70                      <field name="timesheet_hrs" operator="+"/>
71                  </graph>
72             </field>
73         </record>
74
75         <record id="action_report_timesheet_task_user" model="ir.actions.act_window">
76             <field name="name">Task Hours Per Month</field>
77             <field name="res_model">report.timesheet.task.user</field>
78             <field name="view_type">form</field>
79             <field name="view_mode">tree,graph</field>
80             <field name="context">{'search_default_year':1,'search_default_month':1, 'search_default_group_user_id':1}</field>
81         </record>
82         <menuitem id="menu_timesheet_task_user" parent="hr_timesheet.menu_hr_reporting_timesheet"
83                     action="action_report_timesheet_task_user" sequence="1"/>
84
85     </data>
86 </openerp>