======= This PR is in the continuity of odoo#62360. - Display remaining hours in task sales_line_id (name_get + task form view) - Remove internal reference from services demo data - Display sol in project timesheets list if project is billable - Remove use of non_allow_billable in timesheets as it has been removed from project and task in previous PR (see above) - Only recompute planned_hours for service product - Determine the correct SOL for timesheet - Set the last SOL of customer on timesheet if none is set on task or project - Allow edition of so_line in timesheet - Restrict SOL on project to sale lines with a service product - Use same widget on partner_id many2One than in sale.order (using ranking) - Remove timesheets table in SO and invoice portal.They were added in previous PR (see above). This introduces the use of links to /my/timesheets/. - Review portal timesheets (my/timesheets/ and link from orders and invoices) - Activate group_uom "Units of Measure" on sale_timesheet install - Hide partner phone number in task form view - Only determine SOL of task and timesheet if allow_billable=True - Filter SOL in task so that it matches the SOL of the project SO - Display red label if remaining hours is negative - Change SO compute behavior - Only open SO for salesman on project overview task-2409761 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr closes odoo/odoo#63695 Forward-port-of: #62900 X-original-commit: b1985773f3a67e28049f9e2bb635bcab059ad9c0 Related: odoo/enterprise#15427 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
79 lines
4.1 KiB
XML
79 lines
4.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
|
|
<record id="project_project_view_tree_inherit_sale_project" model="ir.ui.view">
|
|
<field name="name">project.project.tree.inherit.sale.project</field>
|
|
<field name="model">project.project</field>
|
|
<field name="inherit_id" ref="project.view_project"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//field[@name='analytic_account_id']" position="after">
|
|
<field name="sale_order_id" optional="hide" widget="sale_order_many2one"/>
|
|
<field name="sale_line_id" optional="hide" widget="sale_order_many2one" readonly="1"/>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="view_edit_project_inherit_form" model="ir.ui.view">
|
|
<field name="name">project.project.view.inherit</field>
|
|
<field name="model">project.project</field>
|
|
<field name="inherit_id" ref="project.edit_project"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//field[@name='partner_id']" position="attributes">
|
|
<attribute name="options">{'always_reload': True}</attribute>
|
|
<attribute name="context">{'res_partner_search_mode': 'customer'}</attribute>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="view_sale_project_inherit_form" model="ir.ui.view">
|
|
<field name="name">project.task.view.inherit</field>
|
|
<field name="model">project.task</field>
|
|
<field name="groups_id" eval="[(4, ref('base.group_user'))]"/>
|
|
<field name="inherit_id" ref="project.view_task_form2"/>
|
|
<field name="arch" type="xml">
|
|
<div name="button_box" position="inside">
|
|
<button class="d-none d-md-inline oe_stat_button"
|
|
type="object" name="action_view_so" icon="fa-dollar"
|
|
attrs="{'invisible': [('sale_order_id', '=', False)]}"
|
|
string="Sales Order"
|
|
groups="sales_team.group_sale_salesman"/>
|
|
</div>
|
|
<xpath expr="//field[@name='partner_id']" position="attributes">
|
|
<attribute name="options">{'always_reload': True}</attribute>
|
|
<attribute name="context">{'res_partner_search_mode': 'customer'}</attribute>
|
|
</xpath>
|
|
<xpath expr="//field[@name='partner_phone']" position="after">
|
|
<field name="sale_order_id" attrs="{'invisible': True}" groups="sales_team.group_sale_salesman"/>
|
|
<field name="sale_line_id" string="Sales Order Item" attrs="{'invisible': [('partner_id', '=', False)]}" options='{"no_open": True}' readonly="1" context="{'create': False, 'edit': False, 'delete': False}"/>
|
|
<field name="commercial_partner_id" invisible="1" />
|
|
<field name="project_sale_order_id" invisible="1"/>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="project_task_view_form_inherit_sale_line_editable" model="ir.ui.view">
|
|
<field name="name">project.task.form.inherit.sale.line.editable.salesman</field>
|
|
<field name="model">project.task</field>
|
|
<field name="inherit_id" ref="view_sale_project_inherit_form"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//field[@name='sale_line_id']" position="attributes">
|
|
<attribute name="options">{"no_create": True}</attribute>
|
|
<attribute name="readonly">0</attribute>
|
|
</xpath>
|
|
</field>
|
|
<field name="groups_id" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
|
|
</record>
|
|
|
|
<record id="project_task_view_search" model="ir.ui.view">
|
|
<field name="name">project.task.search.inherit</field>
|
|
<field name="model">project.task</field>
|
|
<field name="inherit_id" ref="project.view_task_search_form"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//field[@name='stage_id']" position="before">
|
|
<field name="sale_order_id" string="Sale Order" filter_domain="['|', ('sale_order_id', 'ilike', self), ('sale_line_id', 'ilike', self)]"/>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
</odoo>
|