<?xml version="1.0"?>
<data><div name="button_box" position="inside">
                <field name="display_sales_stat_buttons" invisible="1"/>
                <field name="allow_billable" invisible="1"/>
                <field name="privacy_visibility" invisible="1"/>
                <button class="oe_stat_button" type="object" name="action_customer_preview" icon="fa-globe icon" invisible="not partner_id or not allow_billable or privacy_visibility != 'portal'">
                    <div class="o_field_widget o_stat_info">
                        <span class="o_stat_text">Customer</span>
                        <span class="o_stat_text">Preview</span>
                    </div>
                </button>
                <button class="oe_stat_button" type="object" name="action_view_sos" icon="fa-dollar" invisible="not display_sales_stat_buttons or sale_order_count == 0" groups="sales_team.group_sale_salesman_all_leads" context="{                         'create_for_project_id': id,                         'default_project_id': id,                         'default_partner_id': partner_id                     }">
                    <div class="o_field_widget o_stat_info">
                        <span class="o_stat_value">
                            <field name="sale_order_count" nolabel="1"/>
                        </span>
                        <span class="o_stat_text">
                            Sales Orders
                        </span>
                    </div>
                </button>
                <button class="oe_stat_button" type="object" name="action_view_sos" icon="fa-dollar" invisible="not display_sales_stat_buttons or sale_order_count != 0" groups="sales_team.group_sale_salesman_all_leads" context="{                         'create_for_project_id': id,                         'default_project_id': id,                         'default_partner_id': partner_id                     }">
                    <div class="o_field_widget o_stat_info">
                        <span class="o_stat_text">
                            <span class="o_stat_value">0</span> Sales Order
                        </span>
                        <span class="o_stat_text">
                            Make Billable
                        </span>
                    </div>
                </button>
            </div>
            <xpath expr="//header" position="inside">
                <field name="has_any_so_to_invoice" invisible="1"/>
                <field name="has_any_so_with_nothing_to_invoice" invisible="1"/>
            </xpath>
            <xpath expr="//field[@name='partner_id']" position="attributes">
                <attribute name="invisible">not allow_billable</attribute>
            </xpath>
            <xpath expr="//group[@name='group_time_managment']" position="after">
                 <group name="group_sales_invoicing" string="Sales &amp; Invoicing" col="1" class="row mt16 o_settings_container col-lg-6">
                    <div>
                        <setting class="col-lg-12" help="Invoice your time and material to customers" id="allow_billable_container">
                            <field name="allow_billable"/>
                        </setting>
                    </div>
                </group>
            </xpath>
            <xpath expr="//page[@name='settings']//field[@name='privacy_visibility']" position="before">
                <field name="reinvoiced_sale_order_id" invisible="not allow_billable or not partner_id"/>
                <label for="sale_line_id" invisible="not allow_billable or not partner_id"/>
                <div class="o_row" invisible="not allow_billable or not partner_id">
                    <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_edit': True, 'delete': False}" context="{                             'form_view_ref': 'sale_project.sale_order_line_view_form_editable',                             'default_partner_id': partner_id,                             'default_company_id': company_id,                         }"/>
                    <span class="fa fa-exclamation-triangle text-warning" title="The sales order associated with this project has been cancelled. We recommend either updating the sales order item or cancelling this project in alignment with the cancellation of the sales order." invisible="sale_order_state != 'cancel'"/>
                </div>
                <field name="sale_order_state" invisible="1"/>
            </xpath>
        </data>