1 <?xml version="1.0" encoding="utf-8"?>
5 <record id="hr_timesheet_account_form" model="ir.ui.view">
6 <field name="name">hr.timesheet.account.form</field>
7 <field name="model">hr_timesheet_sheet.sheet.account</field>
8 <field name="arch" type="xml">
9 <form string="Timesheet by Accounts" version="7.0">
11 <field name="sheet_id"/>
12 <field name="name" groups="analytic.group_analytic_accounting"/>
13 <field name="total" sum="Total"/>
14 <field name="invoice_rate"/>
19 <record id="hr_timesheet_account_filter" model="ir.ui.view">
20 <field name="name">hr.timesheet.account.filter</field>
21 <field name="model">hr_timesheet_sheet.sheet.account</field>
22 <field name="arch" type="xml">
23 <search string="Search Account">
24 <field name="name" groups="analytic.group_analytic_accounting"/>
25 <field name="invoice_rate"/>
26 <field name="sheet_id" />
30 <record id="hr_timesheet_account_tree" model="ir.ui.view">
31 <field name="name">hr.timesheet.account.tree</field>
32 <field name="model">hr_timesheet_sheet.sheet.account</field>
33 <field name="arch" type="xml">
34 <tree string="Timesheet by Accounts">
35 <field name="sheet_id"/>
36 <field name="name" groups="analytic.group_analytic_accounting"/>
37 <field name="total" sum="Total"/>
38 <field name="invoice_rate"/>
44 <record model="ir.actions.act_window" id="act_hr_timesheet_sheet_sheet_2_hr_analytic_timesheet">
45 <field name="context">{'search_default_sheet_id': [active_id]}</field>
46 <field name="name">Timesheet Activities</field>
47 <field name="res_model">hr.analytic.timesheet</field>
48 <field name="src_model">hr_timesheet_sheet.sheet</field>
52 <record model="ir.actions.act_window" id="act_hr_timesheet_sheet_sheet_2_hr_attendance">
53 <field name="context">{'search_default_sheet_id': [active_id]}</field>
54 <field name="name">Attendances</field>
55 <field name="res_model">hr.attendance</field>
56 <field name="src_model">hr_timesheet_sheet.sheet</field>
60 <record id="hr_timesheet_sheet_form" model="ir.ui.view">
61 <field name="name">hr.timesheet.sheet.form</field>
62 <field name="model">hr_timesheet_sheet.sheet</field>
63 <field name="arch" type="xml">
64 <form string="Timesheet" version="7.0">
66 <button name="button_confirm" states="draft" string="Submit to Manager" type="object" class="oe_highlight"/>
67 <button name="done" states="confirm" string="Approve" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
68 <button name="action_set_to_draft" states="done" string="Set to Draft" type="object" />
69 <button name="cancel" states="confirm" string="Refuse" type="workflow" groups="base.group_hr_user" />
70 <field name="state" widget="statusbar" statusbar_visible="new,confirm,done"/>
73 <div class="oe_right oe_button_box" name="buttons">
75 name="%(act_hr_timesheet_sheet_sheet_2_hr_analytic_timesheet)d"
76 string="Timesheet Activities" />
77 <button type="action" groups="base.group_hr_attendance"
78 name="%(act_hr_timesheet_sheet_sheet_2_hr_attendance)d"
79 string="Attendances" />
81 <div class="oe_title">
82 <label for="employee_id" class="oe_edit_only"/>
83 <h1><field name="employee_id" on_change="onchange_employee_id(employee_id)" class="oe_inline"/></h1>
84 <field name="user_id" invisible="1"/>
88 <label for="date_from" string="Timesheet Period"/>
89 <div><field name="date_from" class="oe_inline"/> to <field name="date_to" class="oe_inline"/></div>
90 <field name="name" invisible="1"/>
91 <field name="department_id" invisible="1"/>
92 <field name="company_id" groups="base.group_multi_company"/>
94 <group groups="base.group_hr_attendance">
95 <field name="total_attendance" widget="float_time"/>
96 <field name="total_timesheet" widget="float_time"/>
97 <field name="total_difference" widget="float_time"/>
101 <page string="Summary">
102 <widget type="weekly_timesheet" attrs="{'readonly': [['state', 'not in', ['new', 'draft']]]}">
105 <page string="Details">
106 <field context="{'employee_id': employee_id, 'user_id':user_id, 'timesheet_date_from': date_from, 'timesheet_date_to': date_to}" name="timesheet_ids" nolabel="1">
107 <tree editable="top" string="Timesheet Activities">
109 <field domain="[('type','in',['normal', 'contract']), ('state', '<>', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id, user_id)" context="{'default_use_timesheets': 1}"/>
111 <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" widget="float_time" string="Hours" sum="Hours"/>
112 <field name="to_invoice" widget="selection"/>
113 <field invisible="1" name="journal_id"/>
114 <field invisible="1" name="product_id" domain="[('type','=','service')]" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)"/>
115 <field invisible="1" name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)"/>
116 <field invisible="1" name="amount"/>
117 <field invisible="1" name="general_account_id"/>
118 <field invisible="1" name="user_id" required="1"/>
120 <form string="Timesheet Activities" version="7.0">
122 <field domain="[('type','=','normal'), ('state', '<>', 'close')]" name="account_id" on_change="on_change_account_id(account_id, user_id)"/>
124 <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" widget="float_time"/>
125 <field name="to_invoice"/>
126 <field name="journal_id"/>
127 <field name="product_id" domain="[('type','=','service')]" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)"/>
128 <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)"/>
129 <field name="amount"/>
130 <field name="general_account_id"/>
131 <field name="user_id" required="1"/>
135 <page string="Attendances" groups="base.group_hr_attendance">
137 <field context="{'employee_id': employee_id, 'user_id':user_id}" name="attendances_ids" nolabel="1">
138 <tree string="Attendances" editable="bottom">
140 <field name="action"/>
141 <field invisible="1" name="employee_id"/>
145 <label for="state_attendance"/>
147 <field name="state_attendance"/>
148 <button name="attendance_action_change" attrs="{'invisible': [('state_attendance', '=', 'present')]}" type="object" string="Sign In" class="oe_link"/>
149 <button name="attendance_action_change" attrs="{'invisible': ['|', ('state_attendance','=',False), ('state_attendance', '=', 'absent')]}" type="object" string="Sign Out" class="oe_link"/>
153 <field name="period_ids">
154 <tree colors="red:total_difference<0.1;blue:total_difference>=0.1" string="Period">
156 <field name="total_attendance" widget="float_time" sum="Attendances"/>
157 <field name="total_timesheet" widget="float_time" sum="Timesheets"/>
158 <field name="total_difference" widget="float_time" sum="Differences"/>
164 <div class="oe_chatter">
165 <field name="message_ids" widget="mail_thread"/>
166 <field name="message_follower_ids" widget="mail_followers"/>
172 <record id="view_hr_timesheet_sheet_filter" model="ir.ui.view">
173 <field name="name">hr_timesheet_sheet.sheet.filter</field>
174 <field name="model">hr_timesheet_sheet.sheet</field>
175 <field name="arch" type="xml">
176 <search string="Search Timesheet">
177 <field name="date_from"/>
178 <filter name="new" string="In Draft" domain="[('state','in',('draft', 'new'))]" help="Unvalidated Timesheets"/>
179 <filter name="to_approve" string="To Approve" domain="[('state','=','confirm')]" help="Confirmed Timesheets"/>
180 <field name="employee_id"/>
181 <field name="department_id"/>
182 <group expand="0" string="Group By...">
183 <filter string="Employees" icon="terp-personal" domain="[]" context="{'group_by':'employee_id'}"/>
184 <filter string="Department" icon="terp-personal+" domain="[]" context="{'group_by':'department_id'}"/>
190 <record id="act_hr_timesheet_sheet_form" model="ir.actions.act_window">
191 <field name="name">Timesheets to Validate</field>
192 <field name="type">ir.actions.act_window</field>
193 <field name="res_model">hr_timesheet_sheet.sheet</field>
194 <field name="view_type">form</field>
195 <field name="view_id" eval="False"/>
196 <field name="context">{'search_default_to_approve':1}</field>
197 <field name="search_view_id" ref="view_hr_timesheet_sheet_filter"/>
198 <field name="help" type="html">
199 <p class="oe_view_nocontent_create">
200 New timesheet to approve.
202 You must record timesheets every day and confirm at the end
203 of the week. Once the timesheet is confirmed, it should be
204 validated by a manager.
206 Timesheets can also be invoiced to customers, depending on the
207 configuration of each project's related contract.
212 <menuitem action="act_hr_timesheet_sheet_form" id="menu_act_hr_timesheet_sheet_form" parent="hr_attendance.menu_hr_time_tracking"
213 sequence="2" groups="base.group_hr_user"/>
219 <record id="hr_timesheet_sheet_company" model="ir.ui.view">
220 <field name="name">res.company.sheet</field>
221 <field name="model">res.company</field>
222 <field name="inherit_id" ref="base.view_company_form"/>
223 <field name="arch" type="xml">
224 <xpath expr="//group[@name='account_grp']" position="after">
225 <group name="timesheets_grp" string="Timesheets">
226 <field name="timesheet_range"/>
227 <field name="timesheet_max_difference"/>
234 hr.analytic.timesheet inheritancy
237 <record id="hr_timesheet_line_form" model="ir.ui.view">
238 <field name="name">hr.analytic.timesheet.form</field>
239 <field name="model">hr.analytic.timesheet</field>
240 <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
241 <field name="arch" type="xml">
242 <field name="date" position="after">
243 <field name="sheet_id" />
248 <record id="hr_timesheet_line_search" model="ir.ui.view">
249 <field name="name">hr.analytic.timesheet.search</field>
250 <field name="model">hr.analytic.timesheet</field>
251 <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_search"/>
252 <field name="arch" type="xml">
253 <field name="date" position="before">
254 <field name="sheet_id"/>
260 hr.attendance inheritancy
263 <record model="ir.ui.view" id="view_hr_attendance_filter">
264 <field name="name">view_hr_attendance_filter</field>
265 <field name="model">hr.attendance</field>
266 <field name="inherit_id" ref="hr_attendance.view_hr_attendance_filter" />
267 <field name="arch" type="xml">
268 <field name="employee_id" position="after">
269 <field name="sheet_id"/>
274 <record id="view_attendance_form" model="ir.ui.view">
275 <field name="name">hr.attendance.form</field>
276 <field name="model">hr.attendance</field>
277 <field name="inherit_id" ref="hr_attendance.view_attendance_form"/>
278 <field name="arch" type="xml">
279 <field name="action_desc" position="after">
280 <field name="sheet_id"/>
284 <record id="view_attendance_tree" model="ir.ui.view">
285 <field name="name">hr.attendance.tree</field>
286 <field name="model">hr.attendance</field>
287 <field name="inherit_id" ref="hr_attendance.view_attendance_tree"/>
288 <field name="arch" type="xml">
289 <field name="action" position="after">
290 <field name="sheet_id"/>
294 <record id="view_attendance_tree_who" model="ir.ui.view">
295 <field name="name">hr.attendance.tree</field>
296 <field name="model">hr.attendance</field>
297 <field name="inherit_id" ref="hr_attendance.view_attendance_who"/>
298 <field name="arch" type="xml">
299 <field name="action" position="after">
300 <field name="sheet_id"/>
306 context="{'search_default_sheet_id': [active_id]}"
307 id="act_hr_timesheet_sheet_sheet_by_account"
308 name="Timesheet by Account"
309 groups="base.group_hr_attendance"
310 res_model="hr_timesheet_sheet.sheet.account"
311 src_model="hr_timesheet_sheet.sheet"/>
314 context="{'search_default_sheet_id': [active_id]}"
315 id="act_hr_timesheet_sheet_sheet_by_day"
316 name="Timesheet by Day"
317 groups="base.group_hr_attendance"
318 res_model="hr_timesheet_sheet.sheet.day"
319 src_model="hr_timesheet_sheet.sheet"/>
321 <record id="hr_timesheet_sheet_tree_simplified" model="ir.ui.view">
322 <field name="name">hr.timesheet.sheet.tree</field>
323 <field name="model">hr_timesheet_sheet.sheet</field>
324 <field eval="10" name="priority"/>
325 <field name="arch" type="xml">
326 <tree colors="blue:state == 'draft';black:state in ('confirm','new');gray:state == 'done'" string="Timesheets">
327 <field name="employee_id"/>
328 <field name="date_from"/>
329 <field name="date_to"/>
330 <field name="department_id" invisible="1"/>
331 <field name="total_attendance" widget="float_time" groups="base.group_hr_attendance"/>
332 <field name="total_timesheet" widget="float_time"/>
333 <field name="total_difference" widget="float_time" groups="base.group_hr_attendance"/>
334 <field name="state"/>
339 <record id="hr_timesheet_day_tree" model="ir.ui.view">
340 <field name="name">hr.timesheet.day.tree</field>
341 <field name="model">hr_timesheet_sheet.sheet.day</field>
342 <field name="arch" type="xml">
343 <tree colors="blue:total_difference<0.1;red:total_difference>=0.1" string="Period">
345 <field name="total_attendance" widget="float_time" sum="Total Attendances" groups="base.group_hr_attendance"/>
346 <field name="total_timesheet" widget="float_time" sum="Total Timesheet"/>
347 <field name="total_difference" widget="float_time" sum="Total Difference" groups="base.group_hr_attendance"/>
352 <!-- Timesheet Button on Employee Form -->
354 <record id="act_hr_employee_2_hr_timesheet" model="ir.actions.act_window">
355 <field name="res_model">hr_timesheet_sheet.sheet</field>
356 <field name="view_type">form</field>
357 <field name="name">Timesheets</field>
358 <field name="view_mode">tree,form</field>
359 <field name="context">{'search_default_employee_id': [active_id], 'default_employee_id': active_id}</field>
362 <record id="hr_timesheet_sheet_employee_extd_form" model="ir.ui.view">
363 <field name="name">hr.timesheet.sheet.employee.extd_form</field>
364 <field name="model">hr.employee</field>
365 <field name="inherit_id" ref="hr_timesheet.hr_timesheet_employee_extd_form"/>
366 <field name="arch" type="xml">
367 <xpath expr="//div[@name='button_box']" position="inside">
368 <button name="%(act_hr_employee_2_hr_timesheet)d" string="Timesheets" type="action" groups="base.group_hr_manager"/>