<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="marketing_campaign_test_view_form" model="ir.ui.view">
        <field name="name">marketing.campaign.test.view.form.test</field>
        <field name="model">marketing.campaign.test</field>
        <field name="priority">20</field>
        <field name="arch" type="xml">
            <form string="Launch a test">
                <sheet>
                    <div class="oe_title">
                        <span class="o_form_label">Choose an existing record or create a new one to test</span>
                        <h2>
                            <field name="resource_ref" required="1" options="{'hide_model': True}"/>
                        </h2>
                    </div>
                    <field name="campaign_id" invisible="1"/>
                    <field name="model_id" readonly="1" invisible="1"/>
                    <field name="res_id" readonly="1" invisible="1"/>
                </sheet>
                <footer>
                    <button string="Continue" name="action_launch_test" type="object" class="btn-primary"/>
                    <button string="Cancel" class="btn-secondary" special="cancel"/>
                </footer>
            </form>
        </field>
    </record>

    <record id="marketing_campaign_test_action" model="ir.actions.act_window">
        <field name="name">Launch a test</field>
        <field name="res_model">marketing.campaign.test</field>
        <field name="binding_model_id" ref="model_marketing_campaign_test"/>
        <field name="binding_view_types">form</field>
        <field name="view_mode">form</field>
        <field name="target">new</field>
        <field name="context">{
            'default_campaign_id': active_id,
        }</field>
    </record>

</odoo>
