<?xml version="1.0" encoding="UTF-8"?>
<odoo>
        <record id="view_op_program_tree" model="ir.ui.view">
            <field name="name">op.program.list</field>
            <field name="model">op.program</field>
            <field name="priority" eval="8"/>
            <field name="arch" type="xml">
                <list string="Program">
                    <field name="name"/>
                    <field name="code"/>
                    <field name="min_unit_load" optional="hide"/>
                    <field name="max_unit_load" optional="hide"/>
                    <field name="department_id" groups="openeducat_core.group_multi_department"/>
                </list>
            </field>
        </record>
        <record id="view_op_program_form" model="ir.ui.view">
            <field name="name">op.program.form</field>
            <field name="model">op.program</field>
            <field name="priority" eval="8"/>
            <field name="arch" type="xml">
                <form string="Programs">
                    <header/>
                    <sheet>
                        <div name="button_box" class="oe_button_box">
                        </div>
                        <field name="active" invisible="True"/>
                        <widget name="web_ribbon" title="Archived" bg_color="bg-danger"
                                invisible="active == True"/>
                                <div class="d-flex justify-content-between">
                                <div class="row oe_title">
                                    <label for="name" string="Program Title"/>
                                    <h1>
                                        <field name="name" options="{'line_breaks': False}" widget="text"
                                               default_focus="1"
                                               placeholder="e.g. &quot;MBA&quot;"/>
                                    </h1>
                                </div>
                                <field name="image_1920" widget="image" class="oe_left oe_avatar"/>
                        </div>
                        <group class="pt-3">
                            <group name="main">
                                <field name="code"/>
                                <field name="min_unit_load"/>
                                <field name="program_level_id"/>
                            </group>
                            <group>
                                <field name="department_id" groups="openeducat_core.group_multi_department"/>
                                <field name="max_unit_load"/>
                            </group>
                        </group>
                    </sheet>
                    <chatter/>
                </form>
            </field>
        </record>
        <record id="view_op_program_search" model="ir.ui.view">
            <field name="name">op.program.search</field>
            <field name="model">op.program</field>
            <field name="priority" eval="8"/>
            <field name="arch" type="xml">
                <search string="Program">
                    <field name="name"/>
                    <field name="code"/>
                    <field name="department_id"/>
                    <field name="active"/>
                    <newline/>
                    <group>
                        <filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
                        <filter string="Department" name="group_by_department" domain="[]"
                                context="{'group_by':'department_id'}"/>
                    </group>
                </search>
            </field>
        </record>
        <record id="view_op_program_pivot" model="ir.ui.view">
            <field name="name">op.program.pivot</field>
            <field name="model">op.program</field>
            <field name="priority" eval="8"/>
            <field name="arch" type="xml">
                <pivot string="Programs">
                    <field name="name" type="row"/>
                    <field name="min_unit_load"/>
                    <field name="max_unit_load"/>
                </pivot>
            </field>
        </record>
        <record model="ir.actions.act_window" id="act_open_op_program_view">
            <field name="name">Programs</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">op.program</field>
            <field name="path">programs</field>
            <field name="binding_view_types">form</field>
            <field name="view_mode">list,form,pivot</field>
            <field name="search_view_id" ref="view_op_program_search"/>
            <field name="domain">[]</field>
            <field name="context">{}</field>
        </record>
</odoo>
