19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:31:00 +01:00
parent a1137a1456
commit e1d89e11e3
2789 changed files with 1093187 additions and 605897 deletions

View file

@ -1,49 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Timesheet root menus -->
<menuitem id="timesheet_menu_root"
name="Timesheets"
sequence="75"
groups="group_hr_timesheet_user"
web_icon="hr_timesheet,static/description/icon_timesheet.png"/>
<menuitem id="menu_hr_time_tracking"
name="Timesheets"
parent="timesheet_menu_root"
groups = "group_hr_timesheet_approver"
sequence="5"/>
<!--
Timesheet line Views
-->
<record id="hr_timesheet_line_tree" model="ir.ui.view">
<field name="name">account.analytic.line.tree.hr_timesheet</field>
<field name="name">account.analytic.line.list.hr_timesheet</field>
<field name="model">account.analytic.line</field>
<field name="arch" type="xml">
<tree editable="bottom" string="Timesheet Activities" sample="1">
<field name="date"/>
<field name="employee_id" invisible="1"/>
<field name="project_id" required="1" options="{'no_create_edit': True, 'no_open': 1}"/>
<field name="task_id" optional="show" options="{'no_create_edit': True, 'no_open': True}" widget="task_with_hours" context="{'default_project_id': project_id}"/>
<field name="name" optional="show" required="0"/>
<field name="unit_amount" optional="show" widget="timesheet_uom" sum="Total" decoration-danger="unit_amount &gt; 24 or unit_amount &lt; 0"/>
<field name="company_id" invisible="1"/>
<field name="user_id" invisible="1"/>
</tree>
<list editable="top" string="Timesheet Activities" sample="1" decoration-muted="readonly_timesheet == True">
<field name="readonly_timesheet" column_invisible="True"/>
<field name="date" readonly="readonly_timesheet"/>
<field name="employee_id" column_invisible="True" readonly="readonly_timesheet"/>
<field name="project_id" options="{'no_create_edit': True}" required="1" readonly="readonly_timesheet"
context="{'search_default_my_projects': True}"/>
<field name="task_id" optional="show" options="{'no_create_edit': True, 'no_open': True}" widget="task_with_hours"
context="{'default_project_id': project_id, 'search_default_my_tasks': True, 'search_default_open_tasks': True}"
readonly="readonly_timesheet"/>
<field name="name" optional="show" required="0" readonly="readonly_timesheet"/>
<field name="unit_amount" string="Time Spent" optional="show" widget="timesheet_uom" sum="Total" readonly="readonly_timesheet"
decoration-danger="unit_amount &gt; 24 or unit_amount &lt; 0" decoration-muted="unit_amount == 0"/>
<field name="company_id" column_invisible="True"/>
<field name="user_id" column_invisible="True"/>
</list>
</field>
</record>
<record id="hr_timesheet_line_portal_tree" model="ir.ui.view">
<field name="name">portal.hr_timesheet.account.analytic.line.list</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="hr_timesheet_line_tree"/>
<field name="mode">primary</field>
<field name="priority">10</field>
<field name="arch" type="xml">
<xpath expr="//list" position="attributes">
<attribute name="edit">0</attribute>
<attribute name="create">0</attribute>
<attribute name="delete">0</attribute>
<attribute name="js_class"></attribute>
</xpath>
<xpath expr="//field[@name='task_id']" position="attributes">
<attribute name="options">{'no_create_edit': True, 'no_open': True}</attribute>
</xpath>
</field>
</record>
<record id="timesheet_view_tree_user" model="ir.ui.view">
<field name="name">account.analytic.line.view.tree.with.user</field>
<field name="name">account.analytic.line.view.list.with.user</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="hr_timesheet_line_tree"/>
<field name="mode">primary</field>
<field name="priority">10</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='employee_id']" position="attributes">
<attribute name="invisible">0</attribute>
<attribute name="column_invisible">0</attribute>
<attribute name="required">1</attribute>
<attribute name="widget">many2one_avatar_employee</attribute>
<attribute name="context">{'active_test': True}</attribute>
@ -58,7 +65,7 @@
<pivot string="Timesheets" sample="1">
<field name="employee_id" type="row"/>
<field name="date" interval="month" type="col"/>
<field name="unit_amount" type="measure" widget="timesheet_uom"/>
<field name="unit_amount" string="Time Spent" type="measure" widget="timesheet_uom"/>
<field name="amount" string="Timesheet Costs"/>
</pivot>
</field>
@ -70,7 +77,7 @@
<field name="arch" type="xml">
<pivot string="Timesheet" sample="1">
<field name="date" interval="week" type="row"/>
<field name="unit_amount" type="measure" widget="timesheet_uom"/>
<field name="unit_amount" string="Time Spent" type="measure" widget="timesheet_uom"/>
<field name="amount" string="Timesheet Costs"/>
</pivot>
</field>
@ -83,7 +90,7 @@
<graph string="Timesheets" sample="1" js_class="hr_timesheet_graphview">
<field name="task_id"/>
<field name="project_id"/>
<field name="unit_amount" type="measure" widget="timesheet_uom"/>
<field name="unit_amount" string="Time Spent" type="measure" widget="timesheet_uom"/>
<field name="amount" string="Timesheet Costs"/>
</graph>
</field>
@ -98,7 +105,7 @@
<field name="date" interval="week"/>
<field name="project_id"/>
<field name="amount" type="measure" string="Timesheet Costs"/>
<field name="unit_amount" type="measure" widget="timesheet_uom"/>
<field name="unit_amount" string="Time Spent" type="measure" widget="timesheet_uom"/>
</graph>
</field>
</record>
@ -112,11 +119,29 @@
<field name="employee_id"/>
<field name="project_id"/>
<field name="amount" type="measure" string="Timesheet Costs"/>
<field name="unit_amount" type="measure" widget="timesheet_uom"/>
<field name="unit_amount" string="Time Spent" type="measure" widget="timesheet_uom"/>
</graph>
</field>
</record>
<!-- For a single project Timesheet view, group by month then task -->
<record id="view_hr_timesheet_line_by_project" model="ir.ui.view">
<field name="name">account.analytic.line.graph.by.project</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="hr_timesheet.view_hr_timesheet_line_graph_all"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<field name="project_id" position="replace"/>
<field name="employee_id" position="before">
<field name="date" interval="month"/>
<field name="task_id"/>
</field>
<field name="employee_id" position="attributes">
<attribute name="invisible">1</attribute>
</field>
</field>
</record>
<record id="view_hr_timesheet_line_graph_by_employee" model="ir.ui.view">
<field name="name">account.analytic.line.graph.by.employee</field>
<field name="model">account.analytic.line</field>
@ -137,34 +162,43 @@
<sheet string="Analytic Entry">
<group>
<group>
<field name="project_id" required="1"/>
<field name="task_id" widget="task_with_hours" context="{'default_project_id': project_id}"/>
<field name="name"/>
<field name="readonly_timesheet" invisible="1"/>
<field name="project_id" options="{'no_create_edit': True}"
context="{'search_default_my_projects': True}"
required="1"
readonly="readonly_timesheet"/>
<field name="task_id" widget="task_with_hours" options="{'no_create_edit': True}"
context="{'default_project_id': project_id, 'search_default_my_tasks': True, 'search_default_open_tasks': True}"
readonly="readonly_timesheet"/>
<field name="company_id" groups="base.group_multi_company" invisible="1"/>
</group>
<group>
<field name="date"/>
<field name="date" readonly="readonly_timesheet"/>
<field name="amount" invisible="1"/>
<field name="unit_amount" widget="timesheet_uom" decoration-danger="unit_amount &gt; 24"/>
<field name="unit_amount" string="Time Spent" widget="timesheet_uom" decoration-danger="unit_amount &gt; 24"
readonly="readonly_timesheet" decoration-muted="unit_amount == 0"/>
<field name="currency_id" invisible="1"/>
<field name="company_id" invisible="1"/>
</group>
</group>
<field name="name" placeholder="Describe your activity" widget="text" nolabel="1" required="0" readonly="readonly_timesheet"/>
</sheet>
</form>
</field>
</record>
<record id="timesheet_view_form_user" model="ir.ui.view">
<field name="name">account.analytic.line.tree.with.user</field>
<field name="name">account.analytic.line.list.with.user</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
<field name="mode">primary</field>
<field name="priority">10</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='date']" position="before">
<field name="employee_id" required="1" context="{'active_test': True}"/>
<field name="user_id" invisible="1"/>
<field name="employee_id" groups="hr_timesheet.group_hr_timesheet_approver" widget="many2one_avatar_employee"
required="1"
readonly="readonly_timesheet" context="{'active_test': True}"/>
<field name="user_id" invisible="1" groups="hr_timesheet.group_hr_timesheet_approver"/>
</xpath>
</field>
</record>
@ -172,29 +206,64 @@
<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="analytic.view_account_analytic_line_filter"/>
<field name="arch" type="xml">
<search string="Timesheet">
<field name="date"/>
<field name="employee_id"/>
<field name="project_id"/>
<field name="ancestor_task_id" groups="project.group_subtask_project"/>
<field name="task_id"/>
<field name="name"/>
<field name="department_id"/>
<field name="manager_id"/>
<xpath expr="//filter[@name='month']" position="before">
<filter name="mine" string="My Timesheets" domain="[('user_id', '=', uid)]"/>
<separator/>
<filter name="month" string="Date" date="date"/>
<group expand="0" string="Group By">
<filter string="Project" name="groupby_project" domain="[]" context="{'group_by': 'project_id'}"/>
<filter string="Ancestor Task" name="groupby_parent_task" domain="[]" context="{'group_by': 'ancestor_task_id'}" groups="project.group_subtask_project"/>
<filter string="Task" name="groupby_task" domain="[]" context="{'group_by': 'task_id'}"/>
<filter string="Date" name="groupby_date" domain="[]" context="{'group_by': 'date'}" help="Timesheet by Date"/>
<filter string="Department" name="groupby_department" domain="[]" context="{'group_by': 'department_id'}"/>
<filter string="Manager" name="groupby_manager" domain="[]" context="{'group_by': 'manager_id'}"/>
<filter string="Employee" name="groupby_employee" domain="[]" context="{'group_by': 'employee_id'}"/>
</group>
</search>
</xpath>
<filter name="month" position="inside">
<filter name="date_this_week" string="This Week" domain="[
('date', '&gt;=', '=week_start'),
('date', '&lt;', '=week_start +1w'),
]"/>
<filter name="date_today" string="Today" domain="[('date', '&gt;=', 'today'), ('date', '&lt;', 'today +1d')]"/>
<filter name="date_last_week" string="Last Week" domain="[
('date', '&gt;=', '=week_start -1w'),
('date', '&lt;', '=week_start'),
]"/>
</filter>
<xpath expr="//group[@name='groupby']" position="before">
<field name="employee_id"/>
<field name="project_id"/>
<field name="task_id"/>
<field name="parent_task_id"/>
<field name="department_id"/>
<field name="manager_id"/>
</xpath>
<xpath expr="//group[@name='groupby']" position="inside">
<filter string="Project" name="groupby_project" domain="[]" context="{'group_by': 'project_id'}"/>
<filter string="Parent Task" name="groupby_parent_task" domain="[]" context="{'group_by': 'parent_task_id'}"/>
<filter string="Task" name="groupby_task" domain="[]" context="{'group_by': 'task_id'}"/>
<filter string="Department" name="groupby_department" domain="[]" context="{'group_by': 'department_id'}"/>
<filter string="Manager" name="groupby_manager" domain="[]" context="{'group_by': 'manager_id'}"/>
<filter string="Employee" name="groupby_employee" domain="[]" context="{'group_by': 'employee_id'}"/>
</xpath>
</field>
</record>
<record id="timesheet_view_form_portal_user" 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.timesheet_view_form_user"/>
<field name="mode">primary</field>
<field name="priority">10</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='employee_id']" position="attributes">
<attribute name="required">1</attribute>
<attribute name="widget">many2one_avatar_employee</attribute>
<attribute name="context">{'active_test': True}</attribute>
<attribute name="options">{'no_open': True}</attribute>
<attribute name="readonly">1</attribute>
</xpath>
<xpath expr="//field[@name='project_id']" position="attributes">
<attribute name="options">{'no_create_edit': True, 'no_open': True}</attribute>
<attribute name="readonly">1</attribute>
</xpath>
<xpath expr="//field[@name='task_id']" position="attributes">
<attribute name="options">{'no_create_edit': True, 'no_open': True}</attribute>
<attribute name="readonly">1</attribute>
</xpath>
</field>
</record>
@ -219,76 +288,133 @@
<field name="model">account.analytic.line</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile" sample="1">
<field name="date"/>
<field name="employee_id"/>
<field name="user_id"/>
<field name="name"/>
<field name="project_id"/>
<field name="task_id" context="{'default_project_id': project_id}" domain="[('project_id', '=', project_id)]"/>
<field name="unit_amount" widget="timesheet_uom"/>
<field name="company_id" invisible="1"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click o_kanban_record_has_image_fill px-0 pb-0">
<div class="oe_kanban_details d-flex flex-column">
<div class="o_kanban_record_top px-2 h-50">
<img t-att-src="kanban_image('hr.employee', 'avatar_128', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value" class="o_image_40_cover float-start"/>
<div class="o_kanban_record_headings ps-4 pe-2">
<div class="text-truncate">
<strong class="o_kanban_record_title">
<span t-esc="record.project_id.value" t-att-title="record.project_id.value"/>
</strong>
</div>
<div class="text-truncate">
<i><span t-esc="record.task_id.value" t-att-title="record.task_id.value"/></i>
</div>
<div class="text-truncate">
<span t-esc="record.name.value" t-att-title="record.name.value"/>
</div>
</div>
</div>
<div class="o_kanban_record_bottom d-block mx-2">
<hr class="mt4 mb4"/>
<span>
<i class="fa fa-calendar me-1" role="img" aria-label="Date" title="Date"></i>
<t t-esc="record.date.value"/>
</span>
<span class="float-end" name="duration">
<strong>Duration: </strong><field name="unit_amount" widget="timesheet_uom" decoration-danger="unit_amount &gt; 24"/>
</span>
</div>
<t t-name="card">
<div class="d-flex gap-1">
<span t-att-title="record.employee_id.value">
<field name="employee_id" widget="image" options="{'preview_image': 'avatar_128'}" class="o_image_64_cover me-2 float-start"/>
</span>
<div class="d-flex flex-column min-w-0 lh-sm">
<span class="text-truncate" invisible="context.get('default_project_id')" t-att-title="record.project_id.value">
<field name="project_id" class="p-0 fw-bold fs-5"/>
</span>
<span name="task_id_wrapper" class="text-truncate" t-att-title="record.task_id.value">
<field name="task_id" invisible="context.get('default_project_id')"/>
<field name="task_id" invisible="not context.get('default_project_id')" class="p-0 fw-bold fs-5"/>
</span>
<span>
<i class="fa fa-calendar me-1" role="img" aria-label="Date" title="Date"></i>
<field name="date"/><span invisible="context.get('is_my_timesheets')"> - <field name="employee_id"/></span>
</span>
<span class="text-truncate" t-att-title="record.name.value"><field name="name" class="fst-italic"/></span>
</div>
</div>
<footer class="mt-0 pt-0">
<div class="d-flex ms-auto">
<strong><field name="unit_amount" widget="timesheet_duration_uom" decoration-danger="unit_amount &gt; 24" decoration-muted="unit_amount == 0" class="ms-1"/></strong>
</div>
</footer>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_calendar_account_analytic_line" model="ir.ui.view">
<field name="name">account.analytic.line.calendar</field>
<field name="model">account.analytic.line</field>
<field name="arch" type="xml">
<calendar
scales="month"
mode="month"
date_start="date"
color="employee_id"
show_unusual_days="True"
multi_create_view="hr_timesheet.view_calendar_account_analytic_line_multi_create"
js_class="timesheet_calendar"
create_name_field="calendar_display_name"
form_view_id="%(hr_timesheet.hr_timesheet_line_form)d"
>
<field name="employee_id" avatar_field="avatar_128" widget="many2one_avatar_employee"/>
<field name="project_id"/>
<field name="task_id" invisible="not task_id"/>
<field name="name"/>
<field name="employee_id" avatar_field="avatar_128" filters="1" write_model="account.analytic.line.calendar.employee" write_field="employee_id" filter_field="checked"/>
</calendar>
</field>
</record>
<record id="view_calendar_account_analytic_line_multi_create" model="ir.ui.view">
<field name="name">account.analytic.line.calendar.multi_create</field>
<field name="model">account.analytic.line</field>
<field name="arch" type="xml">
<form>
<group>
<field name="project_id" options="{'no_create_edit': True}"
context="{'search_default_my_projects': True}" required="1"/>
<field name="task_id" widget="task_with_hours"
context="{'default_project_id': project_id, 'search_default_my_tasks': True, 'search_default_open_tasks': True}"/>
<field name="unit_amount" string="Time Spent" widget="timesheet_uom" decoration-danger="unit_amount &gt; 24"
decoration-muted="unit_amount == 0"/>
<field name="name" required="0" placeholder="e.g. Sending E-mails"/>
</group>
</form>
</field>
</record>
<record id="view_calendar_account_analytic_line_my_timesheets" model="ir.ui.view">
<field name="name">account.analytic.line.calendar</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="hr_timesheet.view_calendar_account_analytic_line"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<calendar position="attributes">
<attribute name="color">project_id</attribute>
<attribute name="js_class">timesheet_calendar_my_timesheets</attribute>
</calendar>
<field name="employee_id" position="replace"/>
<field name="employee_id" filters="1" position="replace"/>
</field>
</record>
<record id="view_kanban_account_analytic_line_portal_user" model="ir.ui.view">
<field name="name">portal.account.analytic.line.kanban</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="hr_timesheet.view_kanban_account_analytic_line"/>
<field name="mode">primary</field>
<field name="priority">10</field>
<field name="arch" type="xml">
<xpath expr="//div/span" position="replace" class="ps-0"/>
</field>
</record>
<!--
Menus and Actions
Actions
-->
<record id="act_hr_timesheet_line" model="ir.actions.act_window">
<field name="name">My Timesheets</field>
<field name="path">timesheets</field>
<field name="res_model">account.analytic.line</field>
<field name="view_mode">tree,form,kanban,pivot,graph</field>
<field name="view_mode">list,form,kanban,pivot,graph</field>
<field name="domain">[('project_id', '!=', False), ('user_id', '=', uid)]</field>
<field name="context">{
"search_default_week":1,
"is_timesheet": 1,
"is_my_timesheets": 1,
}</field>
<field name="search_view_id" ref="hr_timesheet_line_my_timesheet_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No timesheets found. Let's create one!
No activities found. Let's start a new one!
</p>
<p>
Keep track of your working hours by project every day and bill your customers for that time.
Track your working hours by projects every day and invoice this time to your customers.
</p>
</field>
</record>
<record id="act_hr_timesheet_line_view_tree" model="ir.actions.act_window.view">
<field name="view_mode">tree</field>
<field name="view_mode">list</field>
<field name="sequence" eval="4"/>
<field name="view_id" ref="hr_timesheet_line_tree"/>
<field name="act_window_id" ref="act_hr_timesheet_line"/>
@ -301,6 +427,13 @@
<field name="act_window_id" ref="act_hr_timesheet_line"/>
</record>
<record id="act_hr_timesheet_line_view_calendar" model="ir.actions.act_window.view">
<field name="view_mode">calendar</field>
<field name="sequence" eval="5"/>
<field name="view_id" ref="view_calendar_account_analytic_line_my_timesheets"/>
<field name="act_window_id" ref="act_hr_timesheet_line"/>
</record>
<record id="act_hr_timesheet_line_view_kanban" model="ir.actions.act_window.view">
<field name="view_mode">kanban</field>
<field name="sequence">6</field>
@ -310,30 +443,18 @@
<record id="act_hr_timesheet_line_view_pivot" model="ir.actions.act_window.view">
<field name="view_mode">pivot</field>
<field name="sequence">7</field>
<field name="view_id" ref="hr_timesheet.view_my_timesheet_line_pivot"/>
<field name="sequence" eval="7"/>
<field name="view_id" ref="view_my_timesheet_line_pivot"/>
<field name="act_window_id" ref="act_hr_timesheet_line"/>
</record>
<record id="act_hr_timesheet_line_view_graph" model="ir.actions.act_window.view">
<field name="view_mode">graph</field>
<field name="sequence">8</field>
<field name="view_id" ref="hr_timesheet.view_hr_timesheet_line_graph_my"/>
<field name="sequence" eval="8"/>
<field name="view_id" ref="view_hr_timesheet_line_graph_my"/>
<field name="act_window_id" ref="act_hr_timesheet_line"/>
</record>
<menuitem id="timesheet_menu_activity_mine"
name="My Timesheets"
groups="group_hr_timesheet_approver"
parent="menu_hr_time_tracking"
action="act_hr_timesheet_line"/>
<menuitem id="timesheet_menu_activity_user"
name="My Timesheets"
groups="group_hr_timesheet_user"
parent="timesheet_menu_root"
action="act_hr_timesheet_line"/>
<record id="timesheet_action_task" model="ir.actions.act_window">
<field name="name">Task's Timesheets</field>
<field name="res_model">account.analytic.line</field>
@ -341,7 +462,7 @@
'is_timesheet': 1,
}</field>
<field name="domain">[('task_id', 'in', active_ids)]</field>
<field name="view_mode">tree</field>
<field name="view_mode">list</field>
<field name="view_id" ref="timesheet_view_tree_user"/>
</record>
@ -352,14 +473,15 @@
'is_timesheet': 1,
}</field>
<field name="domain">[('project_id', 'in', active_ids)]</field>
<field name="view_mode">tree</field>
<field name="view_mode">list</field>
<field name="view_id" ref="timesheet_view_tree_user"/>
</record>
<record id="timesheet_action_all" model="ir.actions.act_window">
<field name="name">All Timesheets</field>
<field name="res_model">account.analytic.line</field>
<field name="view_mode">tree,form,kanban,pivot,graph</field>
<field name="path">all-timesheets</field>
<field name="view_mode">list,form,kanban,pivot,graph</field>
<field name="search_view_id" ref="hr_timesheet_line_search"/>
<field name="domain">[('project_id', '!=', False)]</field>
<field name="context">{
@ -368,17 +490,17 @@
}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No timesheets found. Let's create one!
No activities found. Let's start a new one!
</p>
<p>
Keep track of your working hours by project every day and bill your customers for that time.
Track your working hours by projects every day and invoice this time to your customers.
</p>
</field>
</record>
<record id="timesheet_action_view_all_tree" model="ir.actions.act_window.view">
<field name="sequence" eval="4"/>
<field name="view_mode">tree</field>
<field name="view_mode">list</field>
<field name="view_id" ref="timesheet_view_tree_user"/>
<field name="act_window_id" ref="timesheet_action_all"/>
</record>
@ -390,6 +512,13 @@
<field name="act_window_id" ref="timesheet_action_all"/>
</record>
<record id="timesheet_action_view_all_calendar" model="ir.actions.act_window.view">
<field name="sequence" eval="5"/>
<field name="view_mode">calendar</field>
<field name="view_id" ref="view_calendar_account_analytic_line"/>
<field name="act_window_id" ref="timesheet_action_all"/>
</record>
<record id="timesheet_action_view_all_kanban" model="ir.actions.act_window.view">
<field name="view_mode">kanban</field>
<field name="sequence">6</field>
@ -411,11 +540,104 @@
<field name="act_window_id" ref="timesheet_action_all"/>
</record>
<menuitem id="timesheet_menu_activity_all"
name="All Timesheets"
parent="menu_hr_time_tracking"
action="timesheet_action_all"
groups="hr_timesheet.group_hr_timesheet_approver"/>
<record id="timesheet_action_from_employee" model="ir.actions.act_window">
<field name="name">Timesheets</field>
<field name="res_model">account.analytic.line</field>
<field name="search_view_id" ref="hr_timesheet_line_search"/>
<field name="domain">[('project_id', '!=', False), ('employee_id', '=', active_id)]</field>
<field name="context">{
'default_employee_id': active_id,
"is_timesheet": 1,
}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Record a new activity
</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 id="act_hr_timesheet_line_by_project" model="ir.actions.act_window">
<field name="name">Timesheets</field>
<field name="res_model">account.analytic.line</field>
<field name="path">project-timesheets</field>
<field name="view_mode">list,kanban,pivot,graph,form</field>
<field name="view_id" ref="timesheet_view_tree_user"/>
<field name="domain">[('project_id', '=', active_id)]</field>
<field name="context">{
"default_project_id": active_id,
"is_timesheet": 1,
}</field>
<field name="search_view_id" ref="hr_timesheet_line_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Record a new activity
</p><p>
Track your working hours by projects every day and invoice this time to your customers.
</p>
</field>
</record>
<record id="project_embedded_action_timesheets" model="ir.embedded.actions">
<field name="parent_res_model">project.project</field>
<field name="sequence">20</field>
<field name="parent_action_id" ref="project.act_project_project_2_project_task_all"/>
<field name="action_id" eval="False"/>
<field name="name">Timesheets</field>
<field name="python_method">action_project_timesheets</field>
<field name="domain">[('allow_timesheets', '=', True)]</field>
<field name="context">{'from_embedded_action': true}</field>
<field name="groups_ids" eval="[(4, ref('hr_timesheet.group_hr_timesheet_user'))]" />
</record>
<record id="project_embedded_action_timesheets_dashboard" model="ir.embedded.actions">
<field name="parent_res_model">project.project</field>
<field name="sequence">30</field>
<field name="parent_action_id" ref="project.project_update_all_action"/>
<field name="action_id" eval="False"/>
<field name="name">Timesheets</field>
<field name="python_method">action_project_timesheets</field>
<field name="domain">[('allow_timesheets', '=', True)]</field>
<field name="context">{'from_embedded_action': true}</field>
<field name="groups_ids" eval="[(4, ref('hr_timesheet.group_hr_timesheet_user'))]" />
</record>
<record id="act_hr_timesheet_line_by_project_view_tree" model="ir.actions.act_window.view">
<field name="view_mode">list</field>
<field name="sequence" eval="1"/>
<field name="view_id" ref="timesheet_view_tree_user"/>
<field name="act_window_id" ref="act_hr_timesheet_line_by_project"/>
</record>
<record id="act_hr_timesheet_line_by_project_view_kanban" model="ir.actions.act_window.view">
<field name="view_mode">kanban</field>
<field name="sequence" eval="2"/>
<field name="view_id" ref="view_kanban_account_analytic_line"/>
<field name="act_window_id" ref="act_hr_timesheet_line_by_project"/>
</record>
<record id="act_hr_timesheet_line_by_project_view_pivot" model="ir.actions.act_window.view">
<field name="view_mode">pivot</field>
<field name="sequence" eval="3"/>
<field name="view_id" ref="view_hr_timesheet_line_pivot"/>
<field name="act_window_id" ref="act_hr_timesheet_line_by_project"/>
</record>
<record id="act_hr_timesheet_line_by_project_view_graph" model="ir.actions.act_window.view">
<field name="view_mode">graph</field>
<field name="sequence" eval="4"/>
<field name="view_id" ref="view_hr_timesheet_line_by_project"/>
<field name="act_window_id" ref="act_hr_timesheet_line_by_project"/>
</record>
<record id="act_hr_timesheet_line_by_project_view_form" model="ir.actions.act_window.view">
<field name="view_mode">form</field>
<field name="sequence" eval="10"/>
<field name="view_id" ref="hr_timesheet_line_form"/>
<field name="act_window_id" ref="act_hr_timesheet_line_by_project"/>
</record>
</data>
</odoo>