<?xml version="1.0"?>
<data><xpath expr="//span[@id='start_rating_buttons']" position="before">
                <button class="oe_stat_button" type="object" name="action_view_so" icon="fa-dollar" invisible="not sale_order_id" groups="sales_team.group_sale_salesman">
                        <div class="o_stat_info">
                            <span class="o_stat_text">Sales Order</span>
                        </div>
                </button>
            </xpath>
            <xpath expr="//field[@name='partner_id']" position="attributes">
                <attribute name="invisible">not allow_billable</attribute>
            </xpath>
            <xpath expr="//field[@name='partner_id']" position="after">
                <field name="project_sale_order_id" invisible="1"/>
                <field name="sale_order_id" invisible="True" groups="sales_team.group_sale_salesman"/>
                <label for="sale_line_id" invisible="not allow_billable or not project_id or not partner_id"/>
                <div name="sale_line_div" class="o_row" invisible="not allow_billable or not project_id or not partner_id">
                    <field name="sale_line_id" groups="!sales_team.group_sale_salesman" string="Sales Order Item" options="{&quot;no_open&quot;: True}" readonly="1" invisible="not sale_line_id"/>
                    <field name="sale_line_id" groups="sales_team.group_sale_salesman" string="Sales Order Item" readonly="0" context="{                             'create': False, 'edit': False, 'delete': False,                             'with_price_unit': True,                             'form_view_ref': 'sale_project.sale_order_line_view_form_editable',                             'default_partner_id': partner_id,                             'default_company_id': company_id,                             'default_order_id': project_sale_order_id,                         }" placeholder="Non-billable"/>
                    <span class="fa fa-exclamation-triangle text-warning" title="The sales order associated with this task has been cancelled. We recommend either updating the sales order item or cancelling this task in alignment with the cancellation of the sales order." invisible="sale_order_state != 'cancel'"/>
                </div>
                <field name="allow_billable" invisible="1"/>
                <field name="sale_order_state" invisible="1"/>
            </xpath>
            <xpath expr="//field[@name='child_ids']/list/field[@name='partner_id']" position="after">
                <field name="sale_line_id" optional="hide" options="{&quot;no_create&quot;: True}" context="{'create': False, 'edit': False, 'delete': False, 'with_price_unit': True}" placeholder="Non-billable" groups="sales_team.group_sale_salesman" invisible="not allow_billable"/>
                <field name="sale_line_id" optional="hide" options="{'no_open': True}" readonly="1" groups="!sales_team.group_sale_salesman"/>
                <field name="allow_billable" column_invisible="True"/>
            </xpath>
            <xpath expr="//field[@name='child_ids']/list/field[@name='partner_id']" position="attributes">
                <attribute name="column_invisible">not parent.allow_billable</attribute>
                <attribute name="invisible">not allow_billable</attribute>
            </xpath>
            <xpath expr="//field[@name='depend_on_ids']/list/field[@name='partner_id']" position="after">
                <field name="sale_line_id" optional="hide" readonly="1" groups="sales_team.group_sale_salesman"/>
                <field name="sale_line_id" optional="hide" options="{'no_open': True}" readonly="1" groups="!sales_team.group_sale_salesman"/>
                <field name="allow_billable" column_invisible="True"/>
            </xpath>
            <xpath expr="//field[@name='depend_on_ids']/list/field[@name='partner_id']" position="attributes">
                <attribute name="column_invisible">not parent.allow_billable</attribute>
                <attribute name="invisible">not allow_billable</attribute>
            </xpath>
            <field name="project_id" position="attributes">
                <attribute name="context">{'default_allow_billable': True}</attribute>
            </field>
        </data>