<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2021 ForgeFlow S.L. (https://www.forgeflow.com)
     License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
 -->
<odoo>
    <record id="view_ddmrp_warning_definition_tree" model="ir.ui.view">
        <field name="name">ddmrp.warning.definition.tree</field>
        <field name="model">ddmrp.warning.definition</field>
        <field name="arch" type="xml">
            <tree>
                <field name="name" />
                <field name="severity" />
                <field name="active" />
            </tree>
        </field>
    </record>
    <record id="view_ddmrp_warning_definition_form" model="ir.ui.view">
        <field name="name">ddmrp.warning.definition.form</field>
        <field name="model">ddmrp.warning.definition</field>
        <field name="arch" type="xml">
            <form>
                <sheet>
                    <widget
                        name="web_ribbon"
                        title="Archived"
                        bg_color="bg-danger"
                        attrs="{'invisible': [('active', '=', True)]}"
                    />
                    <div class="oe_title">
                        <h1>
                            <field name="name" />
                        </h1>
                    </div>
                    <group>
                        <field
                            name="warning_domain"
                            widget="domain"
                            options="{'model': 'stock.buffer', 'in_dialog': true}"
                        />
                        <field name="severity" />
                        <field name="python_code" />
                        <field name="active" invisible="1" />
                    </group>
                </sheet>
            </form>
        </field>
    </record>
    <record id="view_ddmrp_warning_definition_search" model="ir.ui.view">
        <field name="name">ddmrp.warning.definition.search</field>
        <field name="model">ddmrp.warning.definition</field>
        <field name="arch" type="xml">
            <search>
                <field name="name" />
                <field name="severity" />
                <separator />
                <filter
                    string="Archived"
                    name="inactive"
                    domain="[('active', '=', False)]"
                />
            </search>
        </field>
    </record>
    <record id="action_ddmrp_warning_definition" model="ir.actions.act_window">
        <field name="name">DDMRP Warning Definitions</field>
        <field name="res_model">ddmrp.warning.definition</field>
        <field name="view_mode">tree,form</field>
    </record>
    <menuitem
        name="Warning Definitions"
        parent="ddmrp.menu_ddmrp_config"
        id="menu_ddmrp_warning_definition"
        action="action_ddmrp_warning_definition"
        sequence="85"
    />
</odoo>
