~elbati/hr-timesheet/7.0_fix_action_attendances

« back to all changes in this revision

Viewing changes to hr_timesheet_task/hr_timesheet_sheet_view.xml

  • Committer: Guewen Baconnier
  • Author(s): Laetitia Gangloff
  • Date: 2013-04-10 09:27:40 UTC
  • mfrom: (40.1.9 migration_hr_timesheet_taskV7)
  • Revision ID: guewen.baconnier@camptocamp.com-20130410092740-qjxsqutev1narcd3
[MIGR] timesheet_task: migration V7

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<openerp>
3
3
    <data>
 
4
 
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','&lt;=', time.strftime('%%Y-%%m-%%d')),('date_from','&gt;=',time.strftime('%%Y-01-01'))]"
14
15
                        help="Current Year"/>
15
 
                    <filter icon="terp-go-month" string="   Month   " name="month"
16
 
                        domain="[('date_from','&lt;=',(datetime.date.today()+relativedelta(day=31)).strftime('%%Y-%%m-%%d')),('date_from','&gt;=',(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','&lt;=',(context_today()+relativedelta(day=31)).strftime('%%Y-%%m-%%d')),('date_from','&gt;=',(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','&gt;=',(datetime.date.today()+relativedelta(days=-6,weekday=0)).strftime('%%Y-%%m-%%d')),('date_from','&lt;=',(datetime.date.today()+relativedelta(weekday=6)).strftime('%%Y-%%m-%%d'))]"
20
 
                        help="Current week"/>
21
 
                </xpath>
 
19
                    <filter icon="terp-go-week" string="Current Week" separator="1" name="week"
 
20
                        domain="[('date_from','&gt;=',(context_today()+relativedelta(days=-6,weekday=0)).strftime('%%Y-%%m-%%d')),('date_from','&lt;=',(context_today()+relativedelta(weekday=6)).strftime('%%Y-%%m-%%d'))]"
 
21
                        help="Current Week"/>
 
22
                </filter>
22
23
 
23
24
            </field>
24
25
        </record>
 
26
 
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>
27
29
        </record>
32
34
            <field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form"/>
33
35
            <field name="arch" type="xml">
34
36
                <xpath
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']"
36
38
                    position="after">
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)]"/>
39
41
                </xpath>
40
42
                <xpath
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']"
42
44
                    position="after">
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)]"/>
45
47
                </xpath>
46
48
            </field>
47
49
        </record>