<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record model="ir.ui.view" id="vacuum_rule_form_view">
        <field name="name">vacuum.rule.form.view</field>
        <field name="model">vacuum.rule</field>
        <field name="arch" type="xml">
            <form string="Message Vacuum Rule">
                <sheet>
                    <widget
                        name="web_ribbon"
                        text="Archived"
                        bg_color="bg-danger"
                        invisible="active"
                    />
                    <field name="active" invisible="1" />
                    <group col="1">
                        <group col="4">
                            <field name="name" />
                            <field name="ttype" />
                            <field name="company_id" />
                            <field name="retention_time" />
                        </group>
                        <group col="4" invisible="ttype != 'message'">
                            <field name="message_type" required="ttype == 'message'" />
                            <field name="empty_subtype" />
                        </group>
                        <group string="Message Subtypes" invisible="ttype != 'message'">
                            <field name="message_subtype_ids" nolabel="1" colspan="4" />
                        </group>
                        <group invisible="ttype != 'attachment'">
                            <field name="filename_pattern" />
                            <field name="inheriting_model" />
                            <field
                                name="empty_model"
                                invisible="model_ids != [] or not filename_pattern"
                            />
                        </group>
                        <group string="Models">
                            <field name="model_ids" nolabel="1" colspan="4" />
                        </group>
                        <group>
                            <field name="model_id" />
                            <field name="model" invisible="1" />
                            <field
                                name="model_filter_domain"
                                invisible="not model_id"
                                widget="domain"
                                options="{'model': 'model'}"
                            />
                        </group>
                        <group string="Description">
                            <field name="description" />
                        </group>
                    </group>
                </sheet>
            </form>
        </field>
    </record>
    <record model="ir.ui.view" id="vacuum_rule_tree_view">
        <field name="name">vacuum.rule.form.view</field>
        <field name="model">vacuum.rule</field>
        <field name="arch" type="xml">
            <list>
                <field name="name" />
                <field name="company_id" />
                <field name="retention_time" />
            </list>
        </field>
    </record>
    <record model="ir.actions.act_window" id="action_vacuum_rule">
        <field name="name">Message and Attachment Vacuum Rule</field>
        <field name="res_model">vacuum.rule</field>
        <field name="view_mode">list,form</field>
    </record>
    <menuitem
        id="menu_action_vacuum_rule"
        parent="base.menu_email"
        action="action_vacuum_rule"
    />
</odoo>
