summaryrefslogtreecommitdiff
path: root/addons/sale_timesheet_edit/views/project_task.xml
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/sale_timesheet_edit/views/project_task.xml
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/sale_timesheet_edit/views/project_task.xml')
-rw-r--r--addons/sale_timesheet_edit/views/project_task.xml41
1 files changed, 41 insertions, 0 deletions
diff --git a/addons/sale_timesheet_edit/views/project_task.xml b/addons/sale_timesheet_edit/views/project_task.xml
new file mode 100644
index 00000000..f9f7e38e
--- /dev/null
+++ b/addons/sale_timesheet_edit/views/project_task.xml
@@ -0,0 +1,41 @@
+<?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>