19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:32:12 +01:00
parent 79f83631d5
commit 73afc09215
6267 changed files with 1534193 additions and 1130106 deletions

View file

@ -6,53 +6,107 @@
<field name="model">project.project</field>
<field name="inherit_id" ref="hr_timesheet.project_invoice_form"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='action_view_sos'][1]" position="attributes">
<attribute name="context">{'create_for_project_id': id, 'default_project_id': id, 'default_partner_id': partner_id}</attribute>
</xpath>
<xpath expr="//button[@name='action_view_sos'][2]" position="attributes">
<attribute name="context">{'create_for_project_id': id, 'default_project_id': id, 'default_partner_id': partner_id}</attribute>
</xpath>
<xpath expr="//page[@name='settings']" position="after">
<page name="billing_employee_rate" string="Invoicing" attrs="{'invisible': ['|', ('allow_billable', '=', False), ('partner_id', '=', False)]}">
<group>
<group>
<field name="display_create_order" invisible="1"/>
<field name="pricing_type" invisible="1" widget="radio"/>
<field name="timesheet_product_id" string="Default Service" invisible="1" context="{'default_detailed_type': 'service', 'default_service_policy': 'delivered_timesheet', 'default_service_type': 'timesheet'}"/>
<field name="sale_order_id" invisible="1" options="{'no_create': True, 'no_edit': True, 'delete': False, 'no_open': True}"/>
<field name="sale_line_id" groups="!sales_team.group_sale_salesman" options="{'no_create': True, 'no_edit': True, 'delete': False, 'no_open': True}"/>
<field name="sale_line_id" groups="sales_team.group_sale_salesman" options="{'no_create': True, 'no_edit': True, 'delete': False}"/>
</group>
</group>
<field name="sale_line_employee_ids">
<tree editable="bottom">
<field name="company_id" invisible="1"/>
<field name="partner_id" invisible="1"/>
<field name="employee_id" options="{'no_create': True}"/>
<field name="sale_line_id" attrs="{'required': True}" options="{'no_create': True}"/>
<page name="billing_employee_rate" string="Invoicing" invisible="not allow_billable or not partner_id or is_template">
<field name="sale_line_employee_ids" mode="list,kanban" context="{'default_sale_line_id': sale_line_id}">
<list editable="bottom">
<field name="company_id" column_invisible="True"/>
<field name="partner_id" column_invisible="True"/>
<field name="sale_order_id" column_invisible="True"/>
<field name="employee_id" widget="many2one_avatar_employee" context="{'create_project_employee_mapping': company_id}"/>
<field name="existing_employee_ids" column_invisible="True"/>
<field name="sale_line_id" column_invisible="parent.id" required="True" options="{'no_create': True}" context="{'search_default_order_id': sale_order_id}"/>
<field name="sale_line_id" column_invisible="not parent.id" required="True" groups="!sales_team.group_sale_salesman" options="{'no_create': True}"
context="{'search_default_order_id': sale_order_id}"/>
<field name="sale_line_id" column_invisible="not parent.id" required="True" groups="sales_team.group_sale_salesman"
options="{'no_create': True, 'no_open': True}"
context="{
'search_default_order_id': sale_order_id,
'so_form_view_ref': 'sale_project.view_order_simple_form',
'create_for_employee_mapping': True,
'default_partner_id': partner_id,
'default_company_id': company_id,
'default_project_id': project_id,
}"
widget="so_line_create_button"
/>
<field name="price_unit" widget="monetary" force_save="1" options="{'currency_field': 'currency_id'}"/>
<field name="display_cost" widget="monetary" options="{'currency_field': 'cost_currency_id'}"/>
<field name="is_cost_changed" invisible="1"/>
<field name="currency_id" invisible="1"/>
<field name="cost_currency_id" invisible="1"/>
</tree>
<field name="is_cost_changed" column_invisible="True"/>
<field name="currency_id" column_invisible="True"/>
<field name="cost_currency_id" column_invisible="True"/>
</list>
<kanban class="o_kanban_mobile">
<field name="currency_id"/>
<templates>
<t t-name="card">
<div class="row">
<div class="col-8 d-flex">
<field name="employee_id" widget="many2one_avatar_employee"/>
<field name="employee_id" class="fw-bold ps-1"/>
</div>
<div class="col-4 float-end text-end">
<b>Unit Price: </b>
<field name="price_unit" widget="monetary" force_save="1" options="{'currency_field': 'currency_id'}"/>
</div>
</div>
<div class="row">
<field name="sale_line_id" class="col-8 text-muted"/>
<div class="col-4 float-end text-end">
<b>Daily Cost: </b>
<field name="display_cost" widget="monetary" options="{'currency_field': 'currency_id'}"/>
</div>
</div>
</t>
</templates>
</kanban>
<form string="Timesheet Activities">
<sheet>
<group>
<field name="existing_employee_ids" invisible="1"/>
<field name="partner_id" invisible="1"/>
<field name="sale_order_id" invisible="1"/>
<field name="currency_id" invisible="1"/>
<field name="employee_id" widget="many2one_avatar_employee" required="1"/>
<field name="sale_line_id" invisible="parent.id" options="{'no_create': True}" context="{'search_default_order_id': sale_order_id}"/>
<field name="sale_line_id" invisible="not parent.id" required="True" groups="!sales_team.group_sale_salesman" options="{'no_create': True}"
context="{'search_default_order_id': sale_order_id}"/>
<field name="sale_line_id" invisible="not parent.id" required="True" groups="sales_team.group_sale_salesman" options="{'no_create': True}"
widget="so_line_create_button"
context="{
'search_default_order_id': sale_order_id,
'so_form_view_ref': 'sale_project.view_order_simple_form',
'create_for_employee_mapping': True,
'default_partner_id': partner_id,
'default_company_id': company_id,
'default_project_id': project_id,
}"
/>
<field name="price_unit" widget="monetary" readonly="True" force_save="1" options="{'currency_field': 'currency_id'}"/>
<field name="display_cost" widget="monetary" options="{'currency_field': 'currency_id'}"/>
</group>
</sheet>
</form>
</field>
<p class="text-muted">
<i class="fa fa-lightbulb-o"/>
<span>
Define the rate at which an employee's time is billed based on their expertise, skills, or experience.
To bill the same service at a different rate, create separate sales order items.
</span>
</p>
</page>
</xpath>
</field>
</record>
<record id="project_project_view_form_simplified_inherit" model="ir.ui.view">
<field name="name">project.project.view.form.simplified.inherit</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="hr_timesheet.project_project_view_form_simplified_inherit_timesheet"/>
<field name="arch" type="xml">
<xpath expr="//div[hasclass('o_setting_box')]" position="before">
<div class="col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="company_id" invisible="1"/>
<field name="allow_billable"/>
</div>
<div class="o_setting_right_pane">
<label for="allow_billable"/>
<div class="text-muted" id="allow_billable_setting">
Invoice your time and material to customers
</div>
</div>
<xpath expr="//page[@name='settings']//field[@name='allow_billable']" position="after">
<div invisible="not allow_billable or not allow_timesheets" class="text-muted">
Timesheets without a sales order item are reported as
<field name="billing_type" nolabel="1" class="w-auto"/>
</div>
</xpath>
</field>
@ -70,11 +124,11 @@
<field name="pricing_type" invisible="1"/>
</xpath>
<xpath expr="//div[hasclass('o_kanban_manage_reporting')]" position="inside">
<div role="menuitem" t-if="record.rating_active.raw_value" groups="project.group_project_manager">
<div role="menuitem" t-if="record.show_ratings.raw_value" groups="project.group_project_manager">
<a name="action_view_all_rating" type="object">
Customer Ratings
</a>
</div>
</div>
</xpath>
</field>
</record>
@ -84,9 +138,9 @@
<field name="name">project.project.kanban.inherit.sale.timesheet.so.button</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="project.view_project_kanban"/>
<field name="priority">30</field>
<field name="priority">32</field>
<field name="arch" type="xml">
<xpath expr="//div[hasclass('o_kanban_manage_view')]" position="inside">
<xpath expr="//div[@name='card_menu_view']" position="inside">
<div t-if="record.allow_billable.raw_value and record.sale_order_id.raw_value and record.pricing_type.raw_value != 'task_rate'"
role="menuitem"
groups="sales_team.group_sale_salesman_all_leads">
@ -96,31 +150,16 @@
</field>
</record>
<record id="view_sale_service_inherit_form2" model="ir.ui.view">
<field name="name">sale.service.form.view.inherit</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="hr_timesheet.view_task_form2_inherited"/>
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<field name="allow_billable" invisible="1"/>
</xpath>
<xpath expr="//field[@name='child_ids']/tree//field[@name='remaining_hours']" position="after">
<field name="remaining_hours_so" widget="timesheet_uom" optional="hide" groups="base.group_user"/>
</xpath>
<xpath expr="//field[@name='depend_on_ids']/tree//field[@name='remaining_hours']" position="after">
<field name="remaining_hours_so" widget="timesheet_uom" optional="hide" groups="base.group_user"/>
</xpath>
</field>
</record>
<record id="view_task_tree2_inherited" model="ir.ui.view">
<field name="name">project.task.tree.inherited</field>
<field name="name">project.task.list.inherited</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="hr_timesheet.view_task_tree2_inherited" />
<field name="arch" type="xml">
<xpath expr="//field[@name='remaining_hours']" position="after">
<field name="remaining_hours_so" widget="timesheet_uom" optional="hide"/>
<field name="sale_line_id" column_invisible="True"/>
<field name="remaining_hours_available" column_invisible="True"/>
<field name="remaining_hours_so" invisible="not sale_line_id or not remaining_hours_available" widget="timesheet_uom" optional="hide"
groups="hr_timesheet.group_hr_timesheet_user" column_invisible="not (context.get('allow_billable', True) and context.get('allow_timesheets', True)) or context.get('template_project')"/>
</xpath>
</field>
</record>
@ -130,71 +169,75 @@
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_form2"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='timesheet_ids']/tree" position="attributes">
<!-- <field name="timesheet_ids"/> is already inside a block groups="hr_timesheet.group_hr_timesheet_user" -->
<attribute name="decoration-muted">timesheet_invoice_id != False</attribute>
</xpath>
<xpath expr="//field[@name='user_ids']" position="after">
<field name="is_project_map_empty" invisible="1" groups="hr_timesheet.group_hr_timesheet_user"/>
<field name="has_multi_sol" invisible="1" groups="hr_timesheet.group_hr_timesheet_user"/>
</xpath>
<xpath expr="//field[@name='partner_phone']" position="after">
<xpath expr="//field[@name='partner_id']" position="after">
<field name="pricing_type" invisible="1" groups="hr_timesheet.group_hr_timesheet_user"/>
</xpath>
<xpath expr="//field[@name='timesheet_ids']" position="attributes">
<xpath expr="//field[@name='timesheet_ids']/list" position="inside">
<!-- <field name="timesheet_ids"/> is already inside a block groups="hr_timesheet.group_hr_timesheet_user" -->
<attribute name="widget">so_line_one2many</attribute>
<field name="is_so_line_edited" column_invisible="True"/>
</xpath>
<xpath expr="//field[@name='timesheet_ids']/tree" position="inside">
<xpath expr="//field[@name='timesheet_ids']/list/field[@name='unit_amount']" position="before">
<!-- <field name="timesheet_ids"/> is already inside a block groups="hr_timesheet.group_hr_timesheet_user" -->
<field name="is_so_line_edited" invisible="1" />
</xpath>
<xpath expr="//field[@name='timesheet_ids']/tree/field[@name='unit_amount']" position="before">
<!-- <field name="timesheet_ids"/> is already inside a block groups="hr_timesheet.group_hr_timesheet_user" -->
<field name="timesheet_invoice_id" invisible="1"/>
<field name="timesheet_invoice_id" column_invisible="True"/>
<field name="so_line" widget="so_line_field" groups="!sales_team.group_sale_salesman"
attrs="{'column_invisible': [('parent.allow_billable', '=', False)]}"
column_invisible="not parent.allow_billable"
readonly="readonly_timesheet"
context="{'with_remaining_hours': True, 'with_price_unit': True}" options="{'no_create': True, 'no_open': True}"
domain="[('is_service', '=', True), ('order_partner_id', 'child_of', parent.commercial_partner_id), ('is_expense', '=', False), ('state', 'in', ['sale', 'done'])]"
domain="[('is_service', '=', True), ('order_partner_id.commercial_partner_id.id', 'parent_of', parent.partner_id), ('is_expense', '=', False), ('state', '=', 'sale'), ('is_downpayment', '=', False)]"
optional="hide"/>
<field name="so_line" widget="so_line_field" groups="sales_team.group_sale_salesman"
attrs="{'column_invisible': [('parent.allow_billable', '=', False)]}"
context="{'with_remaining_hours': True, 'with_price_unit': True}" options="{'no_create': True}"
domain="[('is_service', '=', True), ('order_partner_id', 'child_of', parent.commercial_partner_id), ('is_expense', '=', False), ('state', 'in', ['sale', 'done'])]"
column_invisible="not parent.allow_billable"
readonly="readonly_timesheet"
context="{'with_remaining_hours': True, 'with_price_unit': True}" options="{'no_create': True, 'no_open': True}"
domain="[('is_service', '=', True), ('order_partner_id.commercial_partner_id.id', 'parent_of', parent.partner_id), ('is_expense', '=', False), ('state', '=', 'sale'), ('is_downpayment', '=', False)]"
optional="hide"/>
</xpath>
<xpath expr="//field[@name='timesheet_ids']/form//field[@name='unit_amount']" position="after">
<field name="timesheet_invoice_id" invisible="1"/>
<field name="so_line" widget="so_line_field" groups="!sales_team.group_sale_salesman"
invisible="not parent.allow_billable"
readonly="readonly_timesheet"
context="{'with_remaining_hours': True, 'with_price_unit': True}" options="{'no_create': True, 'no_open': True}"
domain="[('is_service', '=', True), ('order_partner_id', 'child_of', parent.partner_id), ('is_expense', '=', False), ('state', '=', 'sale')]"
placeholder="Non-billable"
optional="hide"/>
<field
name="so_line" widget="so_line_field" groups="sales_team.group_sale_salesman"
options="{'no_create': True, 'no_open': True}"
context="{'create': False, 'edit': False, 'delete': False, 'with_price_unit': True}"
invisible="not parent.allow_billable"
domain="[('is_service', '=', True), ('order_partner_id', 'child_of', parent.partner_id), ('is_expense', '=', False), ('state', '=', 'sale')]"
readonly="readonly_timesheet"
placeholder="Non-billable"/>
</xpath>
<xpath expr="//field[@name='remaining_hours']" position="after">
<t groups="hr_timesheet.group_hr_timesheet_user">
<field name="sale_order_id" invisible="1"/>
<field name="remaining_hours_available" invisible="1"/>
<span id="remaining_hours_so_label" attrs="{'invisible': ['|', '|', '|', '|', ('allow_billable', '=', False), ('sale_order_id', '=', False), ('partner_id', '=', False), ('sale_line_id', '=', False), ('remaining_hours_available', '=', False)]}" class="o_td_label float-start">
<label class="fw-bold" for="remaining_hours_so" string="Remaining Hours on SO"
attrs="{'invisible': ['|', ('encode_uom_in_days', '=', True), ('remaining_hours_so', '&lt;', 0)]}"/>
<label class="fw-bold" for="remaining_hours_so" string="Remaining Days on SO"
attrs="{'invisible': ['|', ('encode_uom_in_days', '=', False), ('remaining_hours_so', '&lt;', 0)]}"/>
<label class="fw-bold text-danger" for="remaining_hours_so" string="Remaining Hours on SO"
attrs="{'invisible': ['|', ('encode_uom_in_days', '=', True), ('remaining_hours_so', '&gt;=', 0)]}"/>
<label class="fw-bold text-danger" for="remaining_hours_so" string="Remaining Days on SO"
attrs="{'invisible': ['|', ('encode_uom_in_days', '=', False), ('remaining_hours_so', '&gt;=', 0)]}"/>
<span id="remaining_hours_so_label" invisible="not allow_billable or not sale_order_id or not partner_id or not sale_line_id or not remaining_hours_available" class="o_td_label float-start">
<label class="fw-bold" for="remaining_hours_so"
invisible="remaining_hours_so &lt; 0"/>
<label class="fw-bold text-danger" for="remaining_hours_so"
invisible="remaining_hours_so &gt;= 0"/>
</span>
<field name="remaining_hours_so" nolabel="1" widget="timesheet_uom" attrs="{'invisible': ['|', '|', '|', '|', ('allow_billable', '=', False), ('sale_order_id', '=', False), ('partner_id', '=', False), ('sale_line_id', '=', False), ('remaining_hours_available', '=', False)]}" decoration-danger="remaining_hours_so &lt; 0"></field>
<field name="remaining_hours_so" nolabel="1" widget="timesheet_uom" invisible="not allow_billable or not sale_order_id or not partner_id or not sale_line_id or not remaining_hours_available" decoration-danger="remaining_hours_so &lt; 0"></field>
</t>
</xpath>
</field>
</record>
<record id="view_task_form2_inherit_sale_timesheet" model="ir.ui.view">
<field name="name">view.task.form2.inherit</field>
<record id="project_task_view_search_inherit_sale_timesheet" model="ir.ui.view">
<field name="name">project.task.view.search.inherit</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="sale_project.view_sale_project_inherit_form"/>
<field name="inherit_id" ref="hr_timesheet.project_task_view_search"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='sale_line_id'][2]" position="attributes">
<attribute name="context">{'create': False, 'edit': False, 'delete': False, 'with_price_unit': True, 'with_remaining_hours': True}</attribute>
<!-- To do: move allow_billable field in sale_project and add attrs directly on field in master -->
<attribute name="attrs">
{'invisible': [('allow_billable', '=', False)]}
</attribute>
</xpath>
<filter name="timesheet_exceeded" position="attributes">
<attribute name="domain">['|', ('overtime', '&gt;', 0), ('remaining_hours_so', '&lt;', 0)]</attribute>
</filter>
</field>
</record>
</odoo>