<?xml version="1.0" encoding="UTF-8"?>
<odoo>

    <record id="project_create_expense_view_form" model="ir.ui.view">
        <field name="name">project.create.expense.view.form</field>
        <field name="model">project.create.expense</field>
        <field name="arch" type="xml">
            <form string="Create Expense from Project">
                <group>
                <group>
                    <field name="project_id" readonly="1"/>
                    <field name="analytic_id" readonly="1"/>
                    <!--<field name="sale_order_id" options="{'no_create_edit': True}" context="{'sale_show_partner_name': True}"/>-->
                    <field name="description"/>
                </group>
                <group col="4" colspan="2">
                    <field name="ispercentage"/>
                    <field name="expenses_from" attrs="{'invisible':[('ispercentage','=',False)]}"/>
                    <field name="per_from_amt" attrs="{'invisible':[('ispercentage','=',False)]}"/>
                    <field name="percentage_rate" attrs="{'invisible':[('ispercentage','=',False)]}"/>
                </group>
                <group>
                    <field name="expenses_amt"/>
                 </group>
                </group>
                <footer>
                    <button string="Create Expense" type="object" name="action_create_project_expense" class="oe_highlight"/>
                    <button string="Cancel" special="cancel" type="object" class="btn btn-secondary oe_inline"/>
                </footer>
            </form>
        </field>
    </record>

    <record id="project_project_action_multi_create_project_expense" model="ir.actions.act_window">
        <field name="name">Create Expense</field>
        <field name="res_model">project.create.expense</field>
        <field name="view_mode">form</field>
        <field name="view_id" ref="project_create_expense_view_form"/>
        <field name="target">new</field>
    </record>

</odoo>
