<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <!-- Subject Views -->
    <record id="view_encoach_subject_list" model="ir.ui.view">
        <field name="name">encoach.subject.list</field>
        <field name="model">encoach.subject</field>
        <field name="arch" type="xml">
            <list string="Subjects" editable="bottom">
                <field name="sequence" widget="handle"/>
                <field name="name"/>
                <field name="code"/>
                <field name="active" column_invisible="True"/>
            </list>
        </field>
    </record>

    <record id="view_encoach_subject_form" model="ir.ui.view">
        <field name="name">encoach.subject.form</field>
        <field name="model">encoach.subject</field>
        <field name="arch" type="xml">
            <form string="Subject">
                <sheet>
                    <div class="oe_title">
                        <h1><field name="name" placeholder="Subject Name"/></h1>
                    </div>
                    <group>
                        <group>
                            <field name="code"/>
                            <field name="sequence"/>
                            <field name="active"/>
                        </group>
                        <group>
                            <field name="description"/>
                        </group>
                    </group>
                    <notebook>
                        <page string="Domains">
                            <field name="domain_ids">
                                <list>
                                    <field name="sequence" widget="handle"/>
                                    <field name="name"/>
                                    <field name="description"/>
                                </list>
                            </field>
                        </page>
                    </notebook>
                </sheet>
            </form>
        </field>
    </record>

    <record id="action_encoach_subject" model="ir.actions.act_window">
        <field name="name">Subjects</field>
        <field name="res_model">encoach.subject</field>
        <field name="view_mode">list,form</field>
    </record>

    <!-- Domain Views -->
    <record id="view_encoach_domain_list" model="ir.ui.view">
        <field name="name">encoach.domain.list</field>
        <field name="model">encoach.domain</field>
        <field name="arch" type="xml">
            <list string="Domains">
                <field name="sequence" widget="handle"/>
                <field name="name"/>
                <field name="subject_id"/>
                <field name="description"/>
            </list>
        </field>
    </record>

    <record id="view_encoach_domain_form" model="ir.ui.view">
        <field name="name">encoach.domain.form</field>
        <field name="model">encoach.domain</field>
        <field name="arch" type="xml">
            <form string="Domain">
                <sheet>
                    <div class="oe_title">
                        <h1><field name="name" placeholder="Domain Name"/></h1>
                    </div>
                    <group>
                        <group>
                            <field name="subject_id"/>
                            <field name="sequence"/>
                        </group>
                        <group>
                            <field name="description"/>
                        </group>
                    </group>
                    <notebook>
                        <page string="Topics">
                            <field name="topic_ids">
                                <list>
                                    <field name="sequence" widget="handle"/>
                                    <field name="name"/>
                                    <field name="description"/>
                                </list>
                            </field>
                        </page>
                    </notebook>
                </sheet>
            </form>
        </field>
    </record>

    <record id="action_encoach_domain" model="ir.actions.act_window">
        <field name="name">Domains</field>
        <field name="res_model">encoach.domain</field>
        <field name="view_mode">list,form</field>
    </record>

    <!-- Topic Views -->
    <record id="view_encoach_topic_list" model="ir.ui.view">
        <field name="name">encoach.topic.list</field>
        <field name="model">encoach.topic</field>
        <field name="arch" type="xml">
            <list string="Topics">
                <field name="sequence" widget="handle"/>
                <field name="name"/>
                <field name="domain_id"/>
                <field name="description"/>
            </list>
        </field>
    </record>

    <record id="action_encoach_topic" model="ir.actions.act_window">
        <field name="name">Topics</field>
        <field name="res_model">encoach.topic</field>
        <field name="view_mode">list,form</field>
    </record>

    <!-- Menu Items under Content -->
    <menuitem id="menu_taxonomy_subjects"
              name="Subjects"
              parent="encoach_core.menu_encoach_content"
              action="action_encoach_subject"
              sequence="10"/>

    <menuitem id="menu_taxonomy_domains"
              name="Domains"
              parent="encoach_core.menu_encoach_content"
              action="action_encoach_domain"
              sequence="11"/>

    <menuitem id="menu_taxonomy_topics"
              name="Topics"
              parent="encoach_core.menu_encoach_content"
              action="action_encoach_topic"
              sequence="12"/>
</odoo>
