forked from OCA/timesheet
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhr_analytic_timesheet_view.xml
64 lines (63 loc) · 3.5 KB
/
hr_analytic_timesheet_view.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<openerp>
<data>
<!-- Add task on hr.analytic.timesheet -->
<record id="hr_timesheet_line_form" model="ir.ui.view">
<field name="name">hr.analytic.timesheet.form</field>
<field name="model">hr.analytic.timesheet</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
<field name="arch" type="xml">
<field name="user_id" position="after">
<field name="task_id"
context="{'account_id': account_id}"
domain="[('project_id.analytic_account_id','=',account_id)]"/>
</field>
</field>
</record>
<record id="hr_timesheet_line_tree" model="ir.ui.view">
<field name="name">hr.analytic.timesheet.tree</field>
<field name="model">hr.analytic.timesheet</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
<field name="arch" type="xml">
<field name="account_id" position="after">
<field name="task_id"
context="{'account_id': account_id}"
domain="[('project_id.analytic_account_id','=',account_id)]"/>
</field>
</field>
</record>
<!-- Add task on search hr.analytic.timesheet -->
<record id="hr_timesheet_line_search" model="ir.ui.view">
<field name="name">hr.analytic.timesheet.search</field>
<field name="model">hr.analytic.timesheet</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_search"/>
<field name="arch" type="xml">
<field name="date" position="after">
<field name="task_id"/>
</field>
<xpath
expr="/search/group[@string='Group By']/filter[@string='Analytic account']"
position="after">
<filter string="Task" icon="terp-folder-green" context="{'group_by':'task_id'}"
/>
</xpath>
<!-- Add dates filter -->
<xpath expr="/search/group" position="before">
<separator orientation="vertical"/>
<filter icon="terp-go-year" string="Current Year"
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>=',time.strftime('%%Y-01-01'))]"
help="Current Year"/>
<filter icon="terp-go-month" string="Current Month" name="month"
domain="[('date','<=',(context_today()+relativedelta(day=31)).strftime('%%Y-%%m-%%d')),('date','>=',(context_today()-relativedelta(day=1)).strftime('%%Y-%%m-%%d'))]"
help="Current Month"/>
<filter icon="terp-go-week" string="Current Week" separator="1" name="week"
domain="[('date','>=',(context_today()+relativedelta(days=-6,weekday=0)).strftime('%%Y-%%m-%%d')),('date','<=',(context_today()+relativedelta(weekday=6)).strftime('%%Y-%%m-%%d'))]"
help="Current Week"/>
</xpath>
</field>
</record>
<!-- Add default filter on week ! -->
<record id="hr_timesheet.act_hr_timesheet_line_evry1_all_form" model="ir.actions.act_window">
<field name="context">{"search_default_user_id":uid, "search_default_week":1}</field>
</record>
</data>
</openerp>