<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
        <record id="project_task_merge_view_form" model="ir.ui.view">
            <field name='name'>project.task.merge.form</field>
            <field name='model'>project.task.merge</field>
            <field name='arch' type='xml'>
                <form string='Merge Tasks'>
                    <sheet>
                        <group>
                            <group>
                                <field name="user_ids" widget="many2many_tags_avatar" />
                                <field name="task_ids" widget="many2many_tags" />
                            </group>
                            <group>
                                <field name="create_new_task" />
                                <field
                                name="dst_task_name"
                                attrs="{'invisible': [('create_new_task', '=', False)], 'required': [('create_new_task', '=', True)]}"
                            />
                                <field
                                name="dst_project_id"
                                attrs="{'invisible': [('create_new_task', '=', False)], 'required': [('create_new_task', '=', True)]}"
                            />
                                <field
                                name="dst_task_id"
                                attrs="{'invisible': [('create_new_task', '=', True)], 'required': [('create_new_task', '=', False)]}"
                            />
                            </group>
                        </group>
                        <span
                        class="text-muted"
                    >NB: This will archive the selected tasks (Except the destination task)</span>
                    </sheet>
                    <footer>
                        <button
                        name='merge_tasks'
                        string='Merge Tasks'
                        class='oe_highlight'
                        type='object'
                    />
                        <button
                        special="cancel"
                        string="Cancel"
                        type="object"
                        class="btn btn-default oe_inline"
                    />
                    </footer>
                </form>
            </field>
        </record>


    <record id="action_project_task_merge" model="ir.actions.act_window">
        <field name="name">Merge Project Tasks</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">project.task.merge</field>
        <field name="view_mode">form</field>
        <field name="binding_model_id" ref="project.model_project_task" />
        <field name="target">new</field>
    </record>

</odoo>
