odoo/addons/hr_timesheet/hr_timesheet_view.xml

102 lines
5.2 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<menuitem id="timesheet_menu_root" name="Timesheets" sequence="55" groups="base.group_user" web_icon="hr_timesheet,static/description/icon_timesheet.png"/>
<menuitem id="menu_hr_time_tracking" name="My Timesheet" parent="timesheet_menu_root" sequence="5" />
<record id="hr_timesheet_line_tree" model="ir.ui.view">
<field name="name">account.analytic.line.tree.hr_timesheet</field>
<field name="model">account.analytic.line</field>
<field name="arch" type="xml">
<tree editable="top" string="Timesheet Activities">
<field name="date"/>
<field name="user_id" required="1" options='{"no_open": True}'/>
<field name="name"/>
<field name="project_id" required="1"/>
<field name="task_id" context="{'default_project_id': project_id}" domain="[('project_id', '=', project_id)]"/>
<field name="unit_amount" string="Duration" sum="Total time" widget="float_time"/>
</tree>
</field>
</record>
<record id="view_hr_timesheet_line_pivot" model="ir.ui.view">
<field name="name">account.analytic.line.pivot</field>
<field name="model">account.analytic.line</field>
<field name="arch" type="xml">
<pivot string="Timesheet">
<field name="user_id" type="row"/>
<field name="date" interval="month" type="col"/>
<field name="unit_amount" type="measure"/>
</pivot>
</field>
</record>
<record id="hr_timesheet_line_form" model="ir.ui.view">
<field name="name">account.analytic.line.form.inherit.hr_timesheet</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="analytic.view_account_analytic_line_form"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<field name="account_id" position="after">
<field name="project_id" required="1"/>
<field name="task_id" domain="[('project_id', '=', project_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="arch" type="xml">
<search string="Timesheet">
<field name="date"/>
<field name="user_id"/>
<field name="project_id"/>
<field name="task_id"/>
<field name="name"/>
<field name="department_id"/>
<group expand="0" string="Group By">
<filter string="Users" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Project" domain="[]" context="{'group_by':'project_id'}"/>
<filter string="Task" domain="[]" context="{'group_by':'task_id'}"/>
<filter string="Product" domain="[]" context="{'group_by':'product_id'}"/>
<filter string="Timesheet Month" domain="[]" context="{'group_by':'date'}" help="Timesheet by Month"/>
</group>
</search>
</field>
</record>
<record id="act_hr_timesheet_line" model="ir.actions.act_window">
<field name="name">Activities</field>
<field name="res_model">account.analytic.line</field>
<field name="domain">[('project_id', '!=', False)]</field>
<field name="context">{"search_default_today":1}</field>
<field name="search_view_id" ref="hr_timesheet_line_search"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to record activities.
</p><p>
You can register and track your workings hours by project every
day. Every time spent on a project will become a cost and can be re-invoiced to
customers if required.
</p>
</field>
</record>
<record model="ir.actions.act_window.view" id="act_hr_timesheet_line_view_tree">
<field name="view_mode">tree</field>
<field name="sequence">1</field>
<field name="view_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
<field name="act_window_id" ref="act_hr_timesheet_line"/>
</record>
<record model="ir.actions.act_window.view" id="act_hr_timesheet_line_view_form">
<field name="view_mode">form</field>
<field name="sequence">2</field>
<field name="view_id" ref="hr_timesheet.hr_timesheet_line_form"/>
<field name="act_window_id" ref="act_hr_timesheet_line"/>
</record>
<menuitem id="menu_hr_working_hours" parent="menu_hr_time_tracking" action="act_hr_timesheet_line"
name="Detailed Activities"/>
</data>
</odoo>