261 lines
13 KiB
XML
261 lines
13 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
|
|
<record id="hr_timesheet_account_form" model="ir.ui.view">
|
|
<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">
|
|
<group col="4">
|
|
<field name="sheet_id"/>
|
|
<field name="name" groups="analytic.group_analytic_accounting"/>
|
|
<field name="total" sum="Total"/>
|
|
</group>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
<record id="hr_timesheet_account_filter" model="ir.ui.view">
|
|
<field name="name">hr.timesheet.account.filter</field>
|
|
<field name="model">hr_timesheet_sheet.sheet.account</field>
|
|
<field name="arch" type="xml">
|
|
<search string="Search Account">
|
|
<field name="name" groups="analytic.group_analytic_accounting"/>
|
|
<field name="sheet_id" />
|
|
</search>
|
|
</field>
|
|
</record>
|
|
<record id="hr_timesheet_account_tree" model="ir.ui.view">
|
|
<field name="name">hr.timesheet.account.tree</field>
|
|
<field name="model">hr_timesheet_sheet.sheet.account</field>
|
|
<field name="arch" type="xml">
|
|
<tree string="Timesheet by Accounts">
|
|
<field name="sheet_id"/>
|
|
<field name="name" groups="analytic.group_analytic_accounting"/>
|
|
<field name="total" sum="Total"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="hr_timesheet_sheet_tree_simplified" model="ir.ui.view">
|
|
<field name="name">hr.timesheet.sheet.tree</field>
|
|
<field name="model">hr_timesheet_sheet.sheet</field>
|
|
<field name="arch" type="xml">
|
|
<tree decoration-info="state == 'draft'" decoration-muted="state == 'done'" decoration-bf="message_needaction == True" string="Timesheets">
|
|
<field name="employee_id"/>
|
|
<field name="date_from"/>
|
|
<field name="date_to"/>
|
|
<field name="department_id" invisible="1"/>
|
|
<field name="state"/>
|
|
<field name="message_needaction" invisible="1"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="hr_timesheet_sheet_form" model="ir.ui.view">
|
|
<field name="name">hr.timesheet.sheet.form</field>
|
|
<field name="model">hr_timesheet_sheet.sheet</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Timesheet">
|
|
<header>
|
|
<button name="action_timesheet_confirm" states="draft" string="Submit to Manager" type="object" class="oe_highlight"/>
|
|
<button name="action_timesheet_done" states="confirm" string="Approve" type="object" groups="hr_timesheet.group_hr_timesheet_user" class="oe_highlight"/>
|
|
<button name="action_timesheet_draft" states="done" string="Set to Draft" type="object" groups="hr_timesheet.group_hr_timesheet_user"/>
|
|
<button name="action_timesheet_draft" states="confirm" string="Refuse" type="object" groups="hr_timesheet.group_hr_timesheet_user"/>
|
|
<field name="state" widget="statusbar" statusbar_visible="new,confirm,done"/>
|
|
</header>
|
|
<sheet>
|
|
<div class="oe_title">
|
|
<label for="employee_id" class="oe_edit_only"/>
|
|
<h1><field name="employee_id" class="oe_inline" placeholder="Employee's Name"/></h1>
|
|
<field name="user_id" invisible="1"/>
|
|
</div>
|
|
<group>
|
|
<group>
|
|
<label for="date_from" string="Timesheet Period"/>
|
|
<div><field name="date_from" class="oe_inline"/> to <field name="date_to" class="oe_inline"/></div>
|
|
<field name="name" invisible="1"/>
|
|
<field name="department_id" invisible="1"/>
|
|
<field name="company_id" groups="base.group_multi_company"/>
|
|
</group>
|
|
</group>
|
|
<notebook>
|
|
<page string="Summary">
|
|
<widget type="weekly_timesheet" attrs="{'readonly': [['state', 'not in', ['new', 'draft']]]}">
|
|
</widget>
|
|
</page>
|
|
<page string="Details" class="o_hr_timesheet_sheet_details">
|
|
<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="bottom" string="Timesheet Activities">
|
|
<field name="date"/>
|
|
<field name="name"/>
|
|
<field name="project_id" required="1"/>
|
|
<field name="unit_amount" widget="float_time" string="Hours" sum="Hours"/>
|
|
<field name="user_id" invisible="1"/>
|
|
</tree>
|
|
<form string="Timesheet Activities">
|
|
<group>
|
|
<field name="date"/>
|
|
<field name="name"/>
|
|
<field name="project_id"/>
|
|
<field name="unit_amount" widget="float_time" string="Hours"/>
|
|
<field name="user_id" invisible="1"/>
|
|
</group>
|
|
</form>
|
|
</field>
|
|
</page>
|
|
</notebook>
|
|
</sheet>
|
|
<div class="oe_chatter">
|
|
<field name="message_follower_ids" widget="mail_followers"/>
|
|
<field name="message_ids" widget="mail_thread"/>
|
|
</div>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="view_hr_timesheet_sheet_filter" model="ir.ui.view">
|
|
<field name="name">hr_timesheet_sheet.sheet.filter</field>
|
|
<field name="model">hr_timesheet_sheet.sheet</field>
|
|
<field name="arch" type="xml">
|
|
<search string="Search Timesheet">
|
|
<field name="date_from"/>
|
|
<filter name="new" string="In Draft" domain="[('state','in',('draft', 'new'))]" help="Unvalidated Timesheets"/>
|
|
<filter name="to_approve" string="To Approve" domain="[('state','=','confirm')]" help="Confirmed Timesheets"/>
|
|
<filter string="Unread Messages" name="message_needaction" domain="[('message_needaction','=',True)]"/>
|
|
<field name="employee_id"/>
|
|
<field name="department_id"/>
|
|
<group expand="0" string="Group By">
|
|
<filter string="Employees" domain="[]" context="{'group_by':'employee_id'}"/>
|
|
<filter string="Department" domain="[]" context="{'group_by':'department_id'}"/>
|
|
</group>
|
|
</search>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="act_hr_timesheet_sheet_my_timesheets" model="ir.actions.act_window">
|
|
<field name="name">My Timesheets</field>
|
|
<field name="res_model">hr_timesheet_sheet.sheet</field>
|
|
<field name="view_type">form</field>
|
|
<field name="view_mode">tree,form</field>
|
|
<field name="domain">[('employee_id.user_id', '=', uid)]</field>
|
|
<field name="search_view_id" ref="view_hr_timesheet_sheet_filter"/>
|
|
<field name="help" type="html">
|
|
<p class="oe_view_nocontent_create">
|
|
new timesheet.
|
|
</p><p>
|
|
You must record timesheets every day and confirm at the end
|
|
of the week. Once the timesheet is confirmed, it should be
|
|
validated by a manager.
|
|
</p><p>
|
|
Timesheets can also be invoiced to customers, depending on the
|
|
configuration of each project's related contract.
|
|
</p>
|
|
</field>
|
|
</record>
|
|
|
|
<menuitem name="My Current Timesheet" id="menu_act_hr_timesheet_sheet_form_my_current" parent="hr_timesheet.menu_hr_time_tracking" action="ir_actions_server_timesheet_sheet" sequence="2"/>
|
|
|
|
<menuitem action="act_hr_timesheet_sheet_my_timesheets" id="menu_act_hr_timesheet_sheet_my_timesheets" parent="hr_timesheet.menu_hr_time_tracking"
|
|
sequence="3"/>
|
|
|
|
<record id="act_hr_timesheet_sheet_form" model="ir.actions.act_window">
|
|
<field name="name">Timesheets to Approve</field>
|
|
<field name="type">ir.actions.act_window</field>
|
|
<field name="res_model">hr_timesheet_sheet.sheet</field>
|
|
<field name="view_type">form</field>
|
|
<field name="view_id" eval="False"/>
|
|
<field name="context">{'search_default_to_approve':1}</field>
|
|
<field name="search_view_id" ref="view_hr_timesheet_sheet_filter"/>
|
|
<field name="help" type="html">
|
|
<p class="oe_view_nocontent_create">
|
|
New timesheet to approve.
|
|
</p><p>
|
|
You must record timesheets every day and confirm at the end
|
|
of the week. Once the timesheet is confirmed, it should be
|
|
validated by a manager.
|
|
</p><p>
|
|
Timesheets can also be invoiced to customers, depending on the
|
|
configuration of each project's related contract.
|
|
</p>
|
|
</field>
|
|
</record>
|
|
|
|
<record model="ir.actions.act_window.view" id="action_open_timesheet_sheet_holidays_tree">
|
|
<field name="sequence" eval="2"/>
|
|
<field name="view_mode">tree</field>
|
|
<field name="view_id" ref="hr_timesheet_sheet_tree_simplified"/>
|
|
<field name="act_window_id" ref="act_hr_timesheet_sheet_form"/>
|
|
</record>
|
|
|
|
<menuitem id="menu_hr_to_approve" name="To Approve" parent="hr_timesheet.timesheet_menu_root" sequence="7"/>
|
|
|
|
<menuitem action="act_hr_timesheet_sheet_form" id="menu_act_hr_timesheet_sheet_form" parent="menu_hr_to_approve"
|
|
sequence="11" groups="hr_timesheet.group_hr_timesheet_user"/>
|
|
|
|
<!--
|
|
account.analytic.line inheritancy
|
|
-->
|
|
|
|
<record id="hr_timesheet_line_form" model="ir.ui.view">
|
|
<field name="name">account.analytic.line.form</field>
|
|
<field name="model">account.analytic.line</field>
|
|
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
|
|
<field name="arch" type="xml">
|
|
<field name="date" position="after">
|
|
<field name="sheet_id" />
|
|
</field>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="hr_timesheet_line_search" model="ir.ui.view">
|
|
<field name="name">account.analytic.line.search</field>
|
|
<field name="model">account.analytic.line</field>
|
|
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_search"/>
|
|
<field name="arch" type="xml">
|
|
<field name="date" position="before">
|
|
<field name="sheet_id"/>
|
|
</field>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- 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.view_employee_form"/>
|
|
<field name="arch" type="xml">
|
|
<div name="button_box" position="inside">
|
|
<button name="%(act_hr_employee_2_hr_timesheet)d"
|
|
type="action"
|
|
class="oe_stat_button"
|
|
icon="fa-clock-o"
|
|
groups="hr_timesheet.group_hr_timesheet_user">
|
|
<field name="timesheet_count" widget="statinfo" string="Timesheets"/>
|
|
</button>
|
|
</div>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="hr_timesheet_action_from_department" model="ir.actions.act_window">
|
|
<field name="name">Timesheets to Approve</field>
|
|
<field name="res_model">hr_timesheet_sheet.sheet</field>
|
|
<field name="view_type">form</field>
|
|
<field name="view_mode">tree,form</field>
|
|
<field name="context">{
|
|
'search_default_department_id': [active_id],
|
|
'default_department_id': active_id,
|
|
'search_default_to_approve': 1}
|
|
</field>
|
|
</record>
|
|
|
|
</odoo>
|