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

    <record id="view_document_page_tag_search" model="ir.ui.view">
        <field name="name">document.page.tag.search</field>
        <field name="model">document.page.tag</field>
        <field name="arch" type="xml">
            <search string="Document Tag Search">
                <filter
                    string="Archived"
                    name="inactive"
                    domain="[('active','=',False)]"
                />
                <separator />
                <field name="name" filter_domain="[('name', 'ilike', self)]" />
            </search>
        </field>
    </record>

    <record id="view_document_page_tag_form" model="ir.ui.view">
        <field name="name">document.page.tag.form</field>
        <field name="model">document.page.tag</field>
        <field name="arch" type="xml">
            <form string="Tag">
                <sheet>
                    <widget
                        name="web_ribbon"
                        title="Archived"
                        bg_color="bg-danger"
                        attrs="{'invisible': [('active', '=', True)]}"
                    />
                        <group>
                            <field name="active" invisible="1" />
                        </group>
                    <div class="oe_title">
                        <label for="name" class="oe_edit_only" />
                        <h1>
                            <field name="name" required="1" />
                        </h1>
                    </div>
                    <group name="main">
                        <field name="color" widget="color_picker" />
                    </group>
                </sheet>
            </form>
        </field>
    </record>

    <record id="view_document_page_tag_tree" model="ir.ui.view">
        <field name="name">document.page.tag.tree</field>
        <field name="model">document.page.tag</field>
        <field name="arch" type="xml">
            <tree>
                <field name="name" />
                <field name="color" widget="color_picker" string="Color" />
            </tree>
        </field>
    </record>

    <record id="document_page_tag_action" model="ir.actions.act_window">
        <field name="name">Tags</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">document.page.tag</field>
        <field name="view_mode">tree,form</field>
    </record>

    <menuitem
        id="document_page_tag_menu"
        name="Tags"
        parent="document_knowledge.menu_document_configuration"
        action="document_page_tag_action"
        sequence="45"
    />

</odoo>
