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

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="hr_contract_template_view_form" model="ir.ui.view">
<field name="name">hr.contract.template.view.form.inherit.hr_work_entry</field>
<field name="model">hr.version</field>
<field name="inherit_id" ref="hr.hr_contract_template_form_view"/>
<field name="arch" type="xml">
<separator name="schedule" position="after">
<field name="work_entry_source" invisible="1"/>
</separator>
</field>
</record>
</odoo>

View file

@ -6,11 +6,20 @@
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="priority" eval="90"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button type="object" class="oe_stat_button" id="open_work_entries"
icon="fa-calendar" name="action_open_work_entries" string="Work Entries">
<button name="action_open_versions" position="before">
<field name="has_work_entries" invisible="1"/>
<button invisible="not has_work_entries" type="object" class="oe_stat_button" id="open_work_entries"
icon="fa-calendar" name="action_open_work_entries" groups="hr.group_hr_manager">
<div class="o_stat_info">
<span class="o_stat_text">
Work Entries
</span>
</div>
</button>
</div>
</button>
<separator name="schedule" position="after">
<field name="work_entry_source" invisible="1"/>
</separator>
</field>
</record>
</odoo>

View file

@ -7,13 +7,15 @@
<field name="name">Work Entry</field>
<field name="res_model">hr.work.entry</field>
<field name="context">{'search_default_work_entries_error': 1}</field>
<field name="view_mode">tree,calendar,form,pivot</field>
<field name="view_mode">list,form,pivot</field>
</record>
<record id="hr_work_entry_action" model="ir.actions.act_window">
<field name="name">Work Entry</field>
<field name="res_model">hr.work.entry</field>
<field name="view_mode">calendar,tree,form,pivot</field>
<field name="path">work-entries</field>
<field name="view_mode">list,form,pivot</field>
<field name="context">{'search_default_active_employees': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_empty_folder">
No data to display
@ -24,20 +26,49 @@
</field>
</record>
<record id="hr_work_entry_view_calendar_multi_create_form" model="ir.ui.view">
<field name="name">hr.work.entry.calendar.multi_create</field>
<field name="model">hr.work.entry</field>
<field name="priority" eval="50"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<form>
<group>
<field name="work_entry_type_id" widget="many2one_work_entry_type"/>
<label for="duration" />
<div class='d-flex'><field name="duration" widget="float_time"/>hours</div>
<field name="name" string="Description" placeholder="Additional Description..."/>
</group>
<field name="employee_id" invisible="1"/>
<field name="color" invisible="1"/>
<field name="display_code" invisible="1"/>
</form>
</field>
</record>
<record id="hr_work_entry_view_calendar" model="ir.ui.view">
<field name="name">hr.work.entry.calendar</field>
<field name="model">hr.work.entry</field>
<field name="arch" type="xml">
<calendar string="Work Entry"
date_start="date_start"
date_stop="date_stop"
date_start="date"
date_stop="date"
mode="month"
quick_add="False"
scales="month"
show_unusual_days="True"
month_overflow="0"
quick_create="0"
color="color"
event_limit="5">
<!-- Sidebar favorites filters -->
<field name="employee_id" write_model="hr.user.work.entry.employee" write_field="employee_id" avatar_field="avatar_128"/>
event_limit="9"
show_date_picker="0"
multi_create_view="hr_work_entry.hr_work_entry_view_calendar_multi_create_form"
js_class="work_entries_calendar">
<field name="state"/>
<field name="name" string="Description" invisible="not name"/>
<field name="duration" invisible="1"/>
<field name="display_code" invisible="1"/>
<field name="employee_id" invisible="1"/>
<field name="work_entry_type_id" invisible="1"/>
</calendar>
</field>
</record>
@ -48,28 +79,36 @@
<field name="arch" type="xml">
<form string="Work Entry" >
<header>
<field name="state" widget="statusbar" readonly="1" statusbar_visible="draft,validated,conflict"/>
<field name="state" widget="statusbar" statusbar_visible="draft,validated" invisible="state == 'conflict'"/>
<field name="state" widget="statusbar" readonly="1" statusbar_visible="draft,validated,conflict" invisible="state != 'conflict'"/>
</header>
<div class="alert alert-warning text-center" role="alert" attrs="{'invisible': [('state', '!=', 'validated')]}">
<div class="alert alert-warning text-center" role="alert" invisible="state != 'validated'">
Note: Validated work entries cannot be modified.
</div>
<div class="alert alert-warning" invisible="state != 'conflict'" role="alert" name="work_entry_undefined">
<div invisible="work_entry_type_id">
This work entry cannot be validated. The work entry type is undefined.
</div>
<div invisible="not work_entry_type_id">
The amount of work on the day should not exceed 24 hours.
</div>
</div>
<sheet>
<group>
<group>
<field name="name" string="Description" placeholder="Work Entry Name" attrs="{'readonly': [('state', '=', 'validated')]}"/>
<field name="employee_id" attrs="{'readonly': [('state', '!=', 'draft')]}" />
<field name="work_entry_type_id" attrs="{'readonly': [('state', '=', 'validated')]}" options="{'no_create': True, 'no_open': True}"/>
<field name="name" string="Description" placeholder="Additional Description..." readonly="state == 'validated'"/>
<field name="work_entry_type_id" readonly="state == 'validated'" options="{'no_create': True, 'no_open': True}" widget="many2one_work_entry_type"/>
<field name="employee_id" readonly="state == 'validated'" widget="many2one_avatar_employee"/>
</group>
<group>
<field name="date_start" attrs="{'readonly': [('state', '!=', 'draft')]}" />
<field name="date_stop" attrs="{'readonly': [('state', '!=', 'draft')]}" required="1"/>
<field name="date" readonly="state == 'validated'"/>
<label for="duration"/>
<div class="o_row mw-50 mw-sm-25">
<field name="duration"
nolabel="1"
widget="float_time"
class="o_hr_narrow_field"
attrs="{'readonly': [('state', '!=', 'draft')]}" />
readonly="state == 'validated'"/>
<span>Hours</span>
</div>
<field name="company_id" invisible="1"/>
@ -80,18 +119,45 @@
</field>
</record>
<record id="hr_work_entry_calendar_gantt_view_form" model="ir.ui.view">
<field name="name">hr.work.entry.form</field>
<field name="model">hr.work.entry</field>
<field name="mode">primary</field>
<field name="inherit_id" ref="hr_work_entry.hr_work_entry_view_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='employee_id']" position="attributes">
<attribute name="readonly">1</attribute>
</xpath>
<xpath expr="//field[@name='date']" position="attributes">
<attribute name="readonly">1</attribute>
</xpath>
<xpath expr="//field[@name='company_id']" position="attributes">
<attribute name="readonly">1</attribute>
</xpath>
<xpath expr="//field[@name='state']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>
<record id="hr_work_entry_view_tree" model="ir.ui.view">
<field name="name">hr.work.entry.tree</field>
<field name="name">hr.work.entry.list</field>
<field name="model">hr.work.entry</field>
<field name="arch" type="xml">
<tree multi_edit="1" sample="1">
<field name="name"/>
<field name="work_entry_type_id" options="{'no_create': True, 'no_open': True}"/>
<field name="duration" widget="float_time" readonly="1"/>
<field name="state"/>
<field name="date_start" string="Beginning" readonly="1"/>
<field name="date_stop" string="End" readonly="1"/>
</tree>
<list multi_edit="1" sample="1">
<field name="date"/>
<field name="employee_id" widget="many2one_avatar_employee"/>
<field name="work_entry_type_id" options="{'no_create': True, 'no_open': True}" widget="many2one_work_entry_type"/>
<field name="duration" widget="float_time"/>
<field name="state" optional="show" widget="badge"
decoration-info="state == 'draft'"
decoration-success="state == 'validated'"
decoration-warning="state == 'conflict'"
/>
<field name="name" optional="hide"/>
<field name="code" optional="hidden"/>
<field name="external_code" optional="hidden"/>
</list>
</field>
</record>
@ -100,7 +166,9 @@
<field name="model">hr.work.entry</field>
<field name="arch" type="xml">
<pivot string="Work Entries" sample="1">
<field name="duration" widget="float_time" readonly="1"/>
<field name="duration" widget="float_time" type="measure"/>
<field name="employee_id" type="row"/>
<field name="work_entry_type_id" type="col"/>
</pivot>
</field>
</record>
@ -112,21 +180,24 @@
<search string="Search Work Entry">
<field name="employee_id"/>
<field name="department_id"/>
<field name="work_entry_type_id"/>
<field name="work_entry_type_id" widget="many2one_work_entry_type"/>
<field name="name"/>
<filter name="work_entries_draft" string="Draft" domain="[('state', '=', 'draft')]"/>
<filter name="work_entries_validated" string="Validated" domain="[('state', '=', 'validated')]"/>
<filter name="work_entries_error" string="Conflicting" domain="[('state', '=', 'conflict')]"/>
<separator/>
<filter name="date_filter" string="Date" date="date_start"/>
<filter name="date_filter" string="Date" date="date"/>
<filter name="current_month" string="Current Month" domain="[
('date_stop', '&gt;=', (context_today()).strftime('%Y-%m-01')),
('date_start', '&lt;', (context_today() + relativedelta(months=1)).strftime('%Y-%m-01'))]"/>
('date', '&gt;=', '=1d'),
('date', '&lt;', '=1d +1m')]"/>
<separator/>
<filter name="group_employee" string="Employee" context="{'group_by': 'employee_id'}"/>
<filter name="group_department" string="Department" context="{'group_by': 'department_id'}"/>
<filter name="group_work_entry_type" string="Type" context="{'group_by': 'work_entry_type_id'}"/>
<filter name="group_start_date" string="Start Date" context="{'group_by': 'date_start'}"/>
<filter name="group_start_date" string="Date" context="{'group_by': 'date'}"/>
<separator/>
<filter name="archived" string="Archived" domain="[('active', '=', False)]"/>
<filter name="active_employees" string="Active" domain="[('employee_id.active', '=', True)]"/>
<filter name="archived" string="Archived" domain="[('employee_id.active', '=', False)]"/>
</search>
</field>
</record>
@ -148,7 +219,7 @@
<record id="hr_work_entry_type_action" model="ir.actions.act_window">
<field name="name">Work Entry Types</field>
<field name="res_model">hr.work.entry.type</field>
<field name="view_mode">tree,kanban,form</field>
<field name="view_mode">list,kanban,form</field>
<field name="search_view_id" ref="hr_work_entry_type_view_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
@ -158,14 +229,16 @@
</record>
<record id="hr_work_entry_type_view_tree" model="ir.ui.view">
<field name="name">hr.work.entry.type.tree</field>
<field name="name">hr.work.entry.type.list</field>
<field name="model">hr.work.entry.type</field>
<field name="arch" type="xml">
<tree>
<list>
<field name="name"/>
<field name="display_code"/>
<field name="code"/>
<field name="color" widget="color_picker"/>
</tree>
<field name="country_id" optional="hide"/>
</list>
</field>
</record>
@ -175,7 +248,7 @@
<field name="arch" type="xml">
<form string="Work Entry Type" >
<sheet>
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<widget name="web_ribbon" title="Archived" bg_color="text-bg-danger" invisible="active"/>
<div class="oe_title">
<h1>
<field name="name" placeholder="Work Entry Type Name"/>
@ -185,9 +258,19 @@
<group name="identification" class="o_form_fw_labels">
<field name="active" invisible="1"/>
<field name="code"/>
<field name="sequence"/>
<field name="display_code"/>
<field name="external_code"/>
<field name="sequence" groups="base.group_no_one"/>
<field name="color" widget="color_picker"/>
</group>
<group>
<field name="country_id" options="{'no_create': True, 'no_open': True}"/>
<label for="amount_rate"/>
<div class="o_row mw-25" name="amount_rate">
<field name="amount_rate" widget="percentage"/>
</div>
<field name="is_extra_hours"/>
</group>
</group>
<group name="other">
<group name="time_off" string="Time Off Options" class="o_form_fw_labels"/>
@ -201,32 +284,35 @@
<field name="name">hr.work.entry.type.kanban.view</field>
<field name="model">hr.work.entry.type</field>
<field name="arch" type="xml">
<kanban>
<field name="color"/>
<kanban highlight_color="color">
<templates>
<t t-name="kanban-box">
<div t-attf-class="#{!selection_mode ? kanban_color(record.color.raw_value) : ''} oe_kanban_global_click">
<div class="o_dropdown_kanban dropdown" t-if="!selection_mode">
<a class="dropdown-toggle o-no-caret btn" role="button" data-bs-toggle="dropdown" href="#" aria-label="Dropdown menu" title="Dropdown menu">
<span class="fa fa-ellipsis-v"/>
</a>
<div class="dropdown-menu" role="menu">
<ul class="oe_kanban_colorpicker" data-field="color"/>
</div>
</div>
<div class="oe_kanban_content">
<div>
<strong class="o_kanban_record_title"><span><field name="name"/></span></strong>
</div>
<div>
<span class="text-muted o_kanban_record_subtitle"><field name="code"/></span>
</div>
</div>
</div>
<t t-name="menu" t-if="!selection_mode">
<field name="color" widget="kanban_color_picker"/>
</t>
<t t-name="card" t-attf-class="#{!selection_mode ? record.color.raw_value : ''}">
<field class="fw-bold fs-5" name="name"/>
<span class="text-muted">
<field name="code"/>
<t t-if="record.display_code.raw_value" class="text-muted">
(<field name="display_code"/>)
</t>
</span>
</t>
</templates>
</kanban>
</field>
</record>
<record model="ir.actions.server" id="action_hr_work_entry_set_to_draft">
<field name="name">Set to Draft</field>
<field name="sequence" eval="50"/>
<field name="model_id" ref="hr_work_entry.model_hr_work_entry"/>
<field name="binding_model_id" ref="hr_work_entry.model_hr_work_entry"/>
<field name="binding_view_types">list,form</field>
<field name="state">code</field>
<field name="code">
records.action_set_to_draft()
</field>
</record>
</odoo>

View file

@ -12,7 +12,7 @@
</field>
</record>
<record id="resource_calendar_attendance_view_tree" model="ir.ui.view">
<field name="name">resource.calendar.attendance.tree.inherit.hr.work.entry</field>
<field name="name">resource.calendar.attendance.list.inherit.hr.work.entry</field>
<field name="model">resource.calendar.attendance</field>
<field name="inherit_id" ref="resource.view_resource_calendar_attendance_tree"/>
<field name="arch" type="xml">
@ -45,7 +45,7 @@
</record>
<record id="resource_calendar_leave_view_tree" model="ir.ui.view">
<field name="name">resource.calendar.leaves.tree.inherit.hr.work.entry</field>
<field name="name">resource.calendar.leaves.list.inherit.hr.work.entry</field>
<field name="model">resource.calendar.leaves</field>
<field name="inherit_id" ref="resource.resource_calendar_leave_tree"/>
<field name="arch" type="xml">