Files
odoo_source/addons/sale_timesheet_edit/views/project_task.xml
T
fw-bot 0a8f4b6cda Purpose
=======

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>
2020-12-22 13:40:28 +00:00

42 lines
2.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- This view can be removed to change only if it is needed in the inherit view in sale_timesheet -->
<record id="project_task_view_form_inherit_sale_timesheet_edit" model="ir.ui.view">
<field name="name">project.task.form.view.form.inherit.sale.timesheet.edit</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="sale_timesheet.project_task_view_form_inherit_sale_timesheet"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='timesheet_ids']" position="attributes">
<attribute name="widget">so_line_one2many</attribute>
</xpath>
<xpath expr="//field[@name='timesheet_ids']/tree/field[@name='so_line']" position="attributes">
<attribute name="readonly">0</attribute>
<attribute name="domain">[('is_service', '=', True), ('order_partner_id', 'child_of', parent.commercial_partner_id), ('is_expense', '=', False), ('state', 'in', ['sale', 'done']), ('order_id', '=?', parent.project_sale_order_id)]</attribute>
<attribute name="options">{'no_create': True, 'no_open': True}</attribute>
</xpath>
</field>
</record>
<!--
TODO: [XBO] In master, add this view in the sale_timesheet when we will merge of the both modules
Don't forget to change the inherit_id to have the correct view in sale_timesheet,
since the view above can be merged with project_task_view_form_inherit_sale_timesheet view.
-->
<record id="project_task_view_form_inherit_sale_timesheet_editable" model="ir.ui.view">
<field name="name">project.task.form.view.form.inherit.sale.timesheet.editable</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="project_task_view_form_inherit_sale_timesheet_edit"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='timesheet_ids']/tree/field[@name='so_line']" position="attributes">
<attribute name="options">{'no_create': True}</attribute>
</xpath>
<xpath expr="//field[@name='timesheet_ids']/tree" position="inside">
<field name="is_so_line_edited" invisible="1" />
</xpath>
</field>
<field name="groups_id" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
</record>
</odoo>