<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="crm_quotation_partner_view_form" model="ir.ui.view">
        <field name="name">crm.quotation.partner.view.form</field>
        <field name="model">crm.quotation.partner</field>
        <field name="arch" type="xml">
            <form string="Who should be linked to this new Quotation?">
                <group>
                    <field name="action" widget="radio" nolabel="1"/>
                </group>
                <group invisible="action != 'exist'" required="action == 'exist'">
                    <field name="partner_id" widget="many2one_avatar_user" invisible="action != 'exist'" required="action == 'exist'"
                               context="{'res_partner_search_mode': 'customer'}" placeholder="Select a Customer"/>
                </group>
                <footer>
                    <button name="action_apply" string="Go to Quotation" type="object" class="btn-primary" data-hotkey="q"/>
                    <button class="btn-secondary" special="cancel" data-hotkey="x"/>
                </footer>
            </form>
        </field>
    </record>

    <record id="crm_quotation_partner_action" model="ir.actions.act_window">
        <field name="name">Who should be linked to this new Quotation?</field>
        <field name="res_model">crm.quotation.partner</field>
        <field name="view_mode">form</field>
        <field name="view_id" ref="crm_quotation_partner_view_form"/>
        <field name="target">new</field>
        <field name="context">{'dialog_size': 'medium'}</field>
    </record>
</odoo>
