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

    <record id="view_helpdesk_canned_response_tree" model="ir.ui.view">
        <field name="name">so.helpdesk.canned.response.tree</field>
        <field name="model">so.helpdesk.canned.response</field>
        <field name="arch" type="xml">
            <tree>
                <field name="name"/>
                <field name="subject"/>
                <field name="team_ids" widget="many2many_tags"/>
                <field name="active"/>
            </tree>
        </field>
    </record>

    <record id="view_helpdesk_canned_response_form" model="ir.ui.view">
        <field name="name">so.helpdesk.canned.response.form</field>
        <field name="model">so.helpdesk.canned.response</field>
        <field name="arch" type="xml">
            <form>
                <header>
                    <button name="action_apply_to_ticket" type="object"
                            string="Apply to Ticket" class="btn-primary"
                            invisible="not context.get('active_id')"/>
                </header>
                <sheet>
                    <group>
                        <field name="name"/>
                        <field name="subject"/>
                        <field name="team_ids" widget="many2many_tags"/>
                        <field name="active"/>
                    </group>
                    <field name="body"/>
                </sheet>
            </form>
        </field>
    </record>

    <record id="action_helpdesk_canned_response" model="ir.actions.act_window">
        <field name="name">Canned Responses</field>
        <field name="res_model">so.helpdesk.canned.response</field>
        <field name="view_mode">tree,form</field>
    </record>

</odoo>
