HR_TIMESHEET_SHEET
[odoo/odoo.git] / addons / hr_timesheet_sheet / hr_timesheet_sheet_view.xml
1 <?xml version="1.0" ?>
2 <terp>
3         <data>
4                 <record model="ir.ui.view" id="hr_timesheet_sheet_tree">
5                         <field name="name">hr.timesheet.sheet.tree</field>
6                         <field name="model">hr_timesheet_sheet.sheet</field>
7                         <field name="type">tree</field>
8                         <field name="arch" type="xml">
9                                 <tree string="Timesheet Sheet">
10                                         <field name="user_id"/>
11                                         <field name="date_from" />
12                                         <field name="date_to" />
13                                         <field name="name" />
14                                         <field name="total_attendance"/>
15                                         <field name="total_timesheet"/>
16                                         <field name="total_difference"/>
17                                         <field name="state"/>
18                                 </tree>
19                         </field>
20                 </record>
21
22
23                 <record model="ir.ui.view" id="hr_timesheet_account_tree">
24                         <field name="name">hr.timesheet.account.tree</field>
25                         <field name="model">hr_timesheet_sheet.sheet.account</field>
26                         <field name="type">tree</field>
27                         <field name="arch" type="xml">
28                                 <tree string="Timesheet by accounts">
29                                         <field name="sheet_id"/>
30                                         <field name="name"/>
31                                         <field name="total"/>
32                                 </tree>
33                         </field>
34                 </record>
35
36
37
38                 <record model="ir.ui.view" id="hr_timesheet_sheet_form">
39                         <field name="name">hr.timesheet.sheet.form</field>
40                         <field name="model">hr_timesheet_sheet.sheet</field>
41                         <field name="type">form</field>
42                         <field name="arch" type="xml">
43                                 <form string="Timesheet Sheet">
44                                         <field name="name" />
45                                         <field name="user_id"/>
46                                         <field name="date_from" />
47                                         <field name="date_to" />
48
49                                         <notebook colspan="4">
50                                         <page string="Daily view">
51                                                 <group col="4" colspan="2">
52                                                         <field name="date_current" nolabel="1"/>
53                                                         <button icon="STOCK_MEDIA_PREVIOUS" string="" name="date_previous" type="object"/>
54                                                         <button icon="STOCK_JUMP_TO" string="" name="date_today" type="object"/>
55                                                         <button icon="STOCK_MEDIA_NEXT" string="" name="date_next" type="object"/>
56                                                 </group>
57                                                 <button string="Sign In" name="sign_in" type="object"/>
58                                                 <button string="Sign Out" name="sign_out" type="object"/>
59                                                 <field name="attendances_ids" colspan="4" nolabel="1" context="name=date_current" height="100">
60                                                         <tree string="Attendances">
61                                                                 <field name="employee_id"/>
62                                                                 <field name="name"/>
63                                                                 <field name="action"/>
64                                                         </tree>
65                                                 </field>
66                                                 <field name="state_attendance"/>
67                                                 <field name="total_attendance_day" widget="float_time"/>
68                                                 <field name="timesheet_ids" colspan="4" nolabel="1" domain="[('name','=',date_current)]" context="date=date_current">
69                                                         <tree string="Timesheet" editable="top">
70                                                                 <field name="user_id" required="1"/>
71                                                                 <field name="date" />
72                                                                 <field name="account_id" on_change="on_change_account_id(account_id)" domain="[('type','=','normal')]"/>
73                                                                 <field name="name" />
74                                                                 <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" widget="float_time"/>
75                                                                 <field name="product_id" invisible="True"/>
76                                                                 <field name="product_uom_id" invisible="True" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" />
77                                                                 <field name="amount" invisible="True"/>
78                                                                 <field name="general_account_id" invisible="True"/>
79                                                                 <field name="to_invoice"/>
80                                                         </tree>
81                                                 </field>
82                                                 <field name="total_difference_day" widget="float_time"/>
83                                                 <field name="total_timesheet_day" widget="float_time"/>
84                                                 <field name="state"/>
85                                                 <group col="4" colspan="2">
86                                                         <button string="Confirm" name="button_confirm" states="draft" type="object"/>
87                                                         <button string="Cancel" name="cancel" states="done"/>
88                                                         <button string="Refuse" name="cancel" states="confirm"/>
89                                                         <button string="Accept" name="done" states="confirm"/>
90                                                 </group>
91                                         </page><page string="By day">
92                                                 <field name="period_ids" colspan="4" nolabel="1">
93                                                         <tree string="Period" colors="red:total_difference&lt;=0.1;blue:total_difference&gt;=0.1">
94                                                                 <field name="name"/>
95                                                                 <field name="total_attendance" widget="float_time"/>
96                                                                 <field name="total_timesheet" widget="float_time"/>
97                                                                 <field name="total_difference" widget="float_time"/>
98                                                         </tree>
99                                                 </field>
100                                                 <field name="total_attendance" widget="float_time"/>
101                                                 <field name="total_timesheet" widget="float_time"/>
102                                                 <field name="total_difference" widget="float_time"/>
103                                         </page><page string="By account">
104                                                 <field name="account_ids" colspan="4" nolabel="1">
105                                                         <tree string="Analytic accounts">
106                                                                 <field name="name"/>
107                                                                 <field name="total" widget="float_time"/>
108                                                         </tree>
109                                                 </field>
110                                         </page>
111                                         </notebook>
112                                 </form>
113                         </field>
114                 </record>
115
116                 <record model="ir.actions.act_window" id="act_hr_timesheet_sheet_form">
117                         <field name="name">hr.timesheet.sheet.form</field>
118                         <field name="type">ir.actions.act_window</field>
119                         <field name="res_model">hr_timesheet_sheet.sheet</field>
120                         <field name="view_type">form</field>
121                         <field name="view_id" ref="hr_timesheet_sheet_form" />
122                 </record>
123                 <menuitem name="Human Resources/Timesheets/All timesheets"
124                         id="menu_act_hr_timesheet_sheet_form"
125                         action="act_hr_timesheet_sheet_form" />
126
127                 <record model="ir.actions.act_window" id="act_hr_timesheet_sheet_form_my">
128                         <field name="name">hr.timesheet.sheet.form</field>
129                         <field name="type">ir.actions.act_window</field>
130                         <field name="res_model">hr_timesheet_sheet.sheet</field>
131                         <field name="domain">[('user_id','=',uid)]</field>
132                         <field name="view_type">form</field>
133                         <field name="view_mode">tree,form</field>
134                 </record>
135                 <menuitem name="Human Resources/Timesheets/My timesheets"
136                         id="menu_act_hr_timesheet_sheet_form_my"
137                         action="act_hr_timesheet_sheet_form_my" />
138
139                 <record model="ir.actions.act_window" id="act_hr_timesheet_sheet_form_my_confirm">
140                         <field name="name">hr.timesheet.sheet.form</field>
141                         <field name="type">ir.actions.act_window</field>
142                         <field name="res_model">hr_timesheet_sheet.sheet</field>
143                         <field name="domain">[('user_id','=',uid),('state','=','draft'),('date_to','&lt;=',time.strftime('%Y-%m-%d'))]</field>
144                         <field name="view_type">form</field>
145                         <field name="view_mode">tree,form</field>
146                 </record>
147                 <menuitem name="Human Resources/Timesheets/My timesheets/My timesheets to confirm"
148                         id="menu_act_hr_timesheet_sheet_form_my_confirm"
149                         action="act_hr_timesheet_sheet_form_my_confirm" />
150
151                 <wizard string="My current timesheet"
152                         model="hr.employee"
153                         name="hr_timesheet_sheet.current.open"
154                         id="act_hr_timesheet_sheet_form_my_current"/>
155                 <menuitem name="Human Resources/Timesheets/My timesheets/My current timesheet"
156                         id="menu_act_hr_timesheet_sheet_form_my_current"
157                         action="act_hr_timesheet_sheet_form_my_current"
158                         type="wizard"/>
159
160                 <record model="ir.actions.act_window" id="act_hr_timesheet_sheet_form_all_confirm">
161                         <field name="name">hr.timesheet.sheet.form</field>
162                         <field name="type">ir.actions.act_window</field>
163                         <field name="res_model">hr_timesheet_sheet.sheet</field>
164                         <field name="domain">[('state','=','draft'),('date_to','&lt;=',time.strftime('%Y-%m-%d'))]</field>
165                         <field name="view_type">form</field>
166                         <field name="view_mode">tree,form</field>
167                 </record>
168                 <menuitem name="Human Resources/Timesheets/All timesheets/Timesheets to confirm"
169                         id="menu_act_hr_timesheet_sheet_form_all_confirm"
170                         action="act_hr_timesheet_sheet_form_all_confirm" />
171
172                 <record model="ir.actions.act_window" id="act_hr_timesheet_sheet_form_all_valid">
173                         <field name="name">hr.timesheet.sheet.form</field>
174                         <field name="type">ir.actions.act_window</field>
175                         <field name="res_model">hr_timesheet_sheet.sheet</field>
176                         <field name="domain">[('state','=','confirm')]</field>
177                         <field name="view_type">form</field>
178                         <field name="view_mode">tree,form</field>
179                 </record>
180                 <menuitem name="Human Resources/Timesheets/All timesheets/Timesheets to validate"
181                         id="menu_act_hr_timesheet_sheet_form_all_valid"
182                         action="act_hr_timesheet_sheet_form_all_valid" />
183
184                 <!--
185                         Company inheritancy
186                 -->
187
188                 <record model="ir.ui.view" id="hr_timesheet_sheet_company">
189                         <field name="name">res.company.sheet</field>
190                         <field name="model">res.company</field>
191                         <field name="type">form</field>
192                         <field name="inherit_id" ref="base.view_company_form"/>
193                         <field name="arch" type="xml">
194                                 <field name="rml_footer2" position="after">
195                                         <newline/>
196                                         <field name="timesheet_range"/>
197                                         <field name="timesheet_max_difference"/>
198                                         <newline/>
199                                 </field>
200                         </field>
201                 </record>
202
203                 <!--
204                         hr.analytic.timesheet inheritancy
205                 -->
206
207                 <record model="ir.ui.view" id="hr_timesheet_line_tree">
208                         <field name="name">hr.analytic.timesheet.tree</field>
209                         <field name="model">hr.analytic.timesheet</field>
210                         <field name="type">tree</field>
211                         <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
212                         <field name="arch" type="xml">
213                                 <field name="date" position="after">
214                                         <field name="sheet_id"/>
215                                 </field>
216                         </field>
217                 </record>
218                 <record model="ir.ui.view" id="hr_timesheet_line_form">
219                         <field name="name">hr.analytic.timesheet.form</field>
220                         <field name="model">hr.analytic.timesheet</field>
221                         <field name="type">form</field>
222                         <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
223                         <field name="arch" type="xml">
224                                 <field name="date" position="after">
225                                         <field name="sheet_id"/>
226                                 </field>
227                         </field>
228                 </record>
229
230                 <!--
231                         hr.attendance inheritancy
232                 -->
233
234                 <record model="ir.ui.view" id="view_attendance_form">
235                         <field name="name">hr.attendance.form</field>
236                         <field name="model">hr.attendance</field>
237                         <field name="type">form</field>
238                         <field name="inherit_id" ref="hr.view_attendance_form"/>
239                         <field name="arch" type="xml">
240                                 <field name="action_desc" position="after">
241                                         <field name="sheet_id"/>
242                                 </field>
243                         </field>
244                 </record>
245                 <record model="ir.ui.view" id="view_attendance_tree">
246                         <field name="name">hr.attendance.tree</field>
247                         <field name="model">hr.attendance</field>
248                         <field name="type">tree</field>
249                         <field name="inherit_id" ref="hr.view_attendance_tree"/>
250                         <field name="arch" type="xml">
251                                 <field name="action_desc" position="after">
252                                         <field name="sheet_id"/>
253                                 </field>
254                         </field>
255                 </record>
256
257         </data>
258 </terp>