<field name="name">hr.timesheet.account.form</field>
<field name="model">hr_timesheet_sheet.sheet.account</field>
<field name="arch" type="xml">
- <form string="Timesheet by Accounts" version="7.0">
+ <form string="Timesheet by Accounts">
<group col="4">
<field name="sheet_id"/>
<field name="name" groups="analytic.group_analytic_accounting"/>
<field name="name">hr.timesheet.sheet.form</field>
<field name="model">hr_timesheet_sheet.sheet</field>
<field name="arch" type="xml">
- <form string="Timesheet" version="7.0">
+ <form string="Timesheet">
<header>
<button name="button_confirm" states="draft" string="Submit to Manager" type="object" class="oe_highlight"/>
<button name="done" states="confirm" string="Approve" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
<div class="oe_right oe_button_box" name="buttons">
<button type="action"
name="%(act_hr_timesheet_sheet_sheet_2_hr_analytic_timesheet)d"
- string="Timesheet Activities" />
+ class="oe_stat_button"
+ icon="fa-clock-o">
+ <field name="timesheet_activity_count" widget="statinfo" string="Timesheet" help="Timesheet Activities"/>
+ </button>
<button type="action" groups="base.group_hr_attendance"
- name="%(act_hr_timesheet_sheet_sheet_2_hr_attendance)d"
- string="Attendances" />
+ class="oe_stat_button" icon="fa-users"
+ name="%(act_hr_timesheet_sheet_sheet_2_hr_attendance)d">
+ <field name="attendance_count" widget="statinfo" string="Attendances"/>
+ </button>
</div>
<div class="oe_title">
<label for="employee_id" class="oe_edit_only"/>
<h1><field name="employee_id" on_change="onchange_employee_id(employee_id)" class="oe_inline"/></h1>
+ <field name="user_id" invisible="1"/>
</div>
<group>
<group>
<field name="total_attendance" widget="float_time"/>
<field name="total_timesheet" widget="float_time"/>
<field name="total_difference" widget="float_time"/>
- <field name="user_id" invisible="1"/>
</group>
</group>
<notebook>
<page string="Summary">
- <widget type="weekly_timesheet">
+ <widget type="weekly_timesheet" attrs="{'readonly': [['state', 'not in', ['new', 'draft']]]}">
</widget>
</page>
<page string="Details">
- <field context="{'user_id':user_id, 'timesheet_date_from': date_from, 'timesheet_date_to': date_to}" name="timesheet_ids" nolabel="1">
+ <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">
<tree editable="top" string="Timesheet Activities">
<field name="date"/>
<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}"/>
<field invisible="1" name="general_account_id"/>
<field invisible="1" name="user_id" required="1"/>
</tree>
- <form string="Timesheet Activities" version="7.0">
+ <form string="Timesheet Activities">
<field name="date"/>
<field domain="[('type','=','normal'), ('state', '<>', 'close')]" name="account_id" on_change="on_change_account_id(account_id, user_id)"/>
<field name="name"/>
</page>
<page string="Attendances" groups="base.group_hr_attendance">
<group>
- <field context="{'user_id':user_id}" name="attendances_ids" nolabel="1">
+ <field context="{'default_employee_id': employee_id, 'user_id':user_id}" name="attendances_ids" nolabel="1">
<tree string="Attendances" editable="bottom">
<field name="name"/>
<field name="action"/>
<filter name="to_approve" string="To Approve" domain="[('state','=','confirm')]" help="Confirmed Timesheets"/>
<field name="employee_id"/>
<field name="department_id"/>
- <group expand="0" string="Group By...">
+ <group expand="0" string="Group By">
<filter string="Employees" icon="terp-personal" domain="[]" context="{'group_by':'employee_id'}"/>
<filter string="Department" icon="terp-personal+" domain="[]" context="{'group_by':'department_id'}"/>
</group>
<!-- Timesheet Button on Employee Form -->
+ <record id="act_hr_employee_2_hr_timesheet" model="ir.actions.act_window">
+ <field name="res_model">hr_timesheet_sheet.sheet</field>
+ <field name="view_type">form</field>
+ <field name="name">Timesheets</field>
+ <field name="view_mode">tree,form</field>
+ <field name="context">{'search_default_employee_id': [active_id], 'default_employee_id': active_id}</field>
+ </record>
+
<record id="hr_timesheet_sheet_employee_extd_form" model="ir.ui.view">
<field name="name">hr.timesheet.sheet.employee.extd_form</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_employee_extd_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside">
- <button name="open_timesheet" string="Timesheets" type="object" groups="base.group_hr_manager"/>
+ <button name="%(act_hr_employee_2_hr_timesheet)d"
+ type="action"
+ class="oe_stat_button"
+ icon="fa-clock-o"
+ groups="base.group_hr_manager">
+ <field name="timesheet_count" widget="statinfo" string="Timesheets"/>
+ </button>
</xpath>
</field>
</record>