1
1
<?xml version="1.0" encoding="utf-8"?>
4
5
<record id="view_hr_timesheet_sheet_filter_custom" model="ir.ui.view">
5
6
<field name="name">hr_timesheet_sheet.sheet.filter</field>
6
7
<field name="model">hr_timesheet_sheet.sheet</field>
7
8
<field name="inherit_id" ref="hr_timesheet_sheet.view_hr_timesheet_sheet_filter"/>
8
9
<field name="type">search</field>
9
10
<field name="arch" type="xml">
10
<xpath expr="/search/group/filter[@string='To Approve']" position="after">
11
<filter name="to_approve" position="after">
11
12
<separator orientation="vertical"/>
12
<filter icon="terp-go-year" string=" Year "
13
<filter icon="terp-go-year" string="Current Year"
13
14
domain="[('date_from','<=', time.strftime('%%Y-%%m-%%d')),('date_from','>=',time.strftime('%%Y-01-01'))]"
14
15
help="Current Year"/>
15
<filter icon="terp-go-month" string=" Month " name="month"
16
domain="[('date_from','<=',(datetime.date.today()+relativedelta(day=31)).strftime('%%Y-%%m-%%d')),('date_from','>=',(datetime.date.today()-relativedelta(day=1)).strftime('%%Y-%%m-%%d'))]"
16
<filter icon="terp-go-month" string="Current Month" name="month"
17
domain="[('date_from','<=',(context_today()+relativedelta(day=31)).strftime('%%Y-%%m-%%d')),('date_from','>=',(context_today()-relativedelta(day=1)).strftime('%%Y-%%m-%%d'))]"
17
18
help="Current Month"/>
18
<filter icon="terp-go-week" string=" Week " separator="1" name="week"
19
domain="[('date_from','>=',(datetime.date.today()+relativedelta(days=-6,weekday=0)).strftime('%%Y-%%m-%%d')),('date_from','<=',(datetime.date.today()+relativedelta(weekday=6)).strftime('%%Y-%%m-%%d'))]"
19
<filter icon="terp-go-week" string="Current Week" separator="1" name="week"
20
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'))]"
25
27
<record id="hr_timesheet_sheet.act_hr_timesheet_sheet_form" model="ir.actions.act_window">
26
28
<field name="context">{'search_default_my_timesheet':1}</field>
32
34
<field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form"/>
33
35
<field name="arch" type="xml">
35
expr="/form/notebook/page[@string='Daily']/field[@name='timesheet_ids']/tree[@string='Timesheet Lines']/field[@name='account_id']"
37
expr="/form/sheet/notebook/page[@string='Details']/field[@name='timesheet_ids']/tree[@string='Timesheet Activities']/field[@name='account_id']"
37
39
<field name="task_id" context="{'account_id' : account_id}"
38
domain="[('state','=','open')]"/>
40
domain="[('state','=','open'), ('project_id.analytic_account_id','=',account_id)]"/>
41
expr="/form/notebook/page[@string='Daily']/field[@name='timesheet_ids']/form[@string='Timesheet Lines']/field[@name='account_id']"
43
expr="/form/sheet/notebook/page[@string='Details']/field[@name='timesheet_ids']/form[@string='Timesheet Activities']/field[@name='account_id']"
43
45
<field name="task_id" context="{'account_id' : account_id}"
44
domain="[('state','=','open')]"/>
46
domain="[('state','=','open'), ('project_id.analytic_account_id','=',account_id)]"/>