forked from OCA/timesheet
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhr_timesheet_sheet_view.xml
46 lines (43 loc) · 2.72 KB
/
hr_timesheet_sheet_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
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_hr_timesheet_sheet_filter_custom" model="ir.ui.view">
<field name="name">hr_timesheet_sheet.sheet.filter</field>
<field name="model">hr_timesheet_sheet.sheet</field>
<field name="inherit_id" ref="hr_timesheet_sheet.view_hr_timesheet_sheet_filter"/>
<field name="arch" type="xml">
<filter name="to_approve" position="after">
<separator orientation="vertical"/>
<filter icon="terp-go-year" string="Current Year"
domain="[('date_from','<=', time.strftime('%%Y-%%m-%%d')),('date_from','>=',time.strftime('%%Y-01-01'))]"
help="Current Year"/>
<filter icon="terp-go-month" string="Current Month" name="month"
domain="[('date_from','<=',(context_today()+relativedelta(day=31)).strftime('%%Y-%%m-%%d')),('date_from','>=',(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_from','>=',(context_today()+relativedelta(days=-6,weekday=0)).strftime('%%Y-%%m-%%d')),('date_from','<=',(context_today()+relativedelta(weekday=6)).strftime('%%Y-%%m-%%d'))]"
help="Current Week"/>
</filter>
</field>
</record>
<record model="ir.ui.view" id="hr_timesheet_sheet_form_with_activity">
<field name="name">hr.timesheet.sheet.form</field>
<field name="model">hr_timesheet_sheet.sheet</field>
<field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form"/>
<field name="arch" type="xml">
<xpath
expr="/form/sheet/notebook/page[@string='Details']/field[@name='timesheet_ids']/tree[@string='Timesheet Activities']/field[@name='account_id']"
position="after">
<field name="task_id" context="{'account_id' : account_id}"
domain="[('project_id.analytic_account_id','=',account_id)]"/>
</xpath>
<xpath
expr="/form/sheet/notebook/page[@string='Details']/field[@name='timesheet_ids']/form[@string='Timesheet Activities']/field[@name='account_id']"
position="after">
<field name="task_id" context="{'account_id' : account_id}"
domain="[('project_id.analytic_account_id','=',account_id)]"/>
</xpath>
</field>
</record>
</data>
</openerp>