[MERGE] OPW 17833: System does not take into account the currency of the pricelist...
[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="Reporting"
7             parent="hr.menu_hr_root"
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 colspan="4" col="3">
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                         <filter icon="terp-go-month" string=" Month "
39                             name="month"
40                             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'))]"
41                             help="Task Hours in current month"/>
42                         <filter icon="terp-go-month"
43                             string=" Month-1 "
44                             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'))]"
45                             help="Task hours of last month"/>                           
46                                 <separator orientation="vertical"/>
47                             <field name="user_id"/>
48                         </group>
49                         <newline/>
50                         <group expand="1" string="Group By..." colspan="4" col="3">
51                             <filter string="User" name="group_user_id" icon="terp-personal" context="{'group_by':'user_id'}"/>
52                         <separator orientation="vertical"/>
53                         <filter string="Month" icon="terp-go-month" context="{'group_by':'month'}" help="Group by month of date"/>
54                         <filter string="Year" icon="terp-go-year" context="{'group_by':'year'}" help="Group by year of date"/>
55                     </group>
56
57                 </search>
58             </field>
59         </record>
60         
61         <record id="view_task_hour_per_month_graph" model="ir.ui.view">
62             <field name="name">report.timesheet.task.user.graph</field>
63             <field name="model">report.timesheet.task.user</field>
64             <field name="type">graph</field>
65             <field name="arch" type="xml">
66                 <graph string="Task Hours Per Month" type="bar">
67                      <field name="user_id"/>
68                      <field name="task_hrs" operator="+"/>
69                      <field name="timesheet_hrs" operator="+"/>
70                  </graph>
71             </field>
72         </record>
73                 
74         <record id="action_report_timesheet_task_user" model="ir.actions.act_window">
75             <field name="name">Task Hours Per Month</field>
76             <field name="res_model">report.timesheet.task.user</field>
77             <field name="view_type">form</field>
78             <field name="view_mode">tree,graph</field>
79             <field name="context">{'search_default_month':1, 'search_default_group_user_id':1}</field>
80         </record>
81         <menuitem id="menu_timesheet_task_user" parent="hr_timesheet.menu_hr_reporting_timesheet"
82                     action="action_report_timesheet_task_user" sequence="1"/>
83
84     </data>
85 </openerp>