1 <?xml version="1.0" encoding="utf-8"?>
5 id="hr.menu_hr_reporting"
7 parent="hr.menu_hr_root"
10 <!-- Report for Users' Timesheet and Task Hours per Month -->
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"/>
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 "
36 domain="[('name','<=', time.strftime('%%Y-%%m-%%d')),('name','>=',time.strftime('%%Y-01-01'))]"
37 help="Task Hours in current year"/>
38 <filter icon="terp-go-month" string=" Month "
40 domain="[('name','<=',(datetime.date.today()+relativedelta(day=31)).strftime('%%Y-%%m-%%d')),('name','>=',(datetime.date.today()-relativedelta(day=1)).strftime('%%Y-%%m-%%d'))]"
41 help="Task Hours in current month"/>
42 <filter icon="terp-go-month"
44 domain="[('name','<=', (datetime.date.today() - relativedelta(day=31, months=1)).strftime('%%Y-%%m-%%d')),('name','>=',(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"/>
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"/>
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="+"/>
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>
81 <menuitem id="menu_timesheet_task_user" parent="hr_timesheet.menu_hr_reporting_timesheet"
82 action="action_report_timesheet_task_user" sequence="1"/>