<odoo>
    <!-- Inherited form view to add linked_to_department and hr_department_id -->
    <record id="view_services_settings_form_inherit_empowerment" model="ir.ui.view">
        <field name="name">services.settings.form.empowerment</field>
        <field name="model">services.settings</field>
        <field name="inherit_id" ref="odex_benefit.services_settings_form"/> <!-- Adjust ref to actual base form -->
        <field name="arch" type="xml">
            <xpath expr="//sheet/group[1]" position="after">
                <group>

                    <field name="linked_to_department"  />
                    <field name="hr_department_id"/>
                    <field name="manager_id"   />
                </group>

            </xpath>
        </field>
    </record>

    <!-- Tree view for services.settings, extended -->
    <record id="view_services_settings_tree_inherit_empowerment" model="ir.ui.view">
        <field name="name">services.settings.tree.empowerment</field>
        <field name="model">services.settings</field>
        <field name="inherit_id" ref="odex_benefit.services_settings_tree"/>
        <field name="arch" type="xml">
            <xpath expr="//tree" position="inside">
                <field name="linked_to_department"/>
                <field name="hr_department_id"/>

            </xpath>
        </field>
    </record>

    <!-- View for Empowerment Education Entity -->
    <record id="view_empowerment_education_entity_form" model="ir.ui.view">
        <field name="name">empowerment.education.entity.form</field>
        <field name="model">empowerment.education.entity</field>
        <field name="arch" type="xml">
            <form string="الجهات التعليمية">
                <sheet>
                    <group>
                        <field name="name"/>
                        <field name="entity_type"/>
                        <field name="specialization_id"/>
                        <field name="study_specialization"/>
                    </group>
                </sheet>
            </form>
        </field>
    </record>

    <record id="view_empowerment_education_entity_tree" model="ir.ui.view">
        <field name="name">empowerment.education.entity.tree</field>
        <field name="model">empowerment.education.entity</field>
        <field name="arch" type="xml">
            <tree string="الجهات التعليمية">
                <field name="name"/>
                <field name="entity_type"/>
                <field name="specialization_id"/>
                <!--                <field name="study_specialization"/>-->
            </tree>
        </field>
    </record>

    <!-- Action menu for Education Entities -->
    <record id="action_empowerment_education_entity" model="ir.actions.act_window">
        <field name="name">الجهات التعليمية</field>
        <field name="res_model">empowerment.education.entity</field>
        <field name="view_mode">tree,form</field>
    </record>

    <record id="view_study_specialization_form" model="ir.ui.view">
        <field name="name">empowerment.study.specialization.form</field>
        <field name="model">empowerment.study.specialization</field>
        <field name="arch" type="xml">
            <form string="تخصص الدراسة">
                <sheet>
                    <group>
                        <field name="type"/>
                        <field name="universities_colleges"
                               attrs="{'invisible': [('type', '!=', 'bachelor')]}"
                        />
                        <field name="institutes_schools"
                               attrs="{'invisible': [('type', '!=', 'diploma')]}"
                        />
                    </group>
                </sheet>
            </form>
        </field>
    </record>

    <record id="action_study_specialization" model="ir.actions.act_window">
        <field name="name">تخصص الدراسة</field>
        <field name="res_model">empowerment.study.specialization</field>
        <field name="view_mode">tree,form</field>
    </record>


    <record id="view_qualification_course_tree" model="ir.ui.view">
        <field name="name">empowerment.qualification.course.tree</field>
        <field name="model">empowerment.qualification.course</field>
        <field name="arch" type="xml">
            <tree>
                <field name="name"/>
            </tree>
        </field>
    </record>

    <!-- Form View -->
    <record id="view_qualification_course_form" model="ir.ui.view">
        <field name="name">empowerment.qualification.course.form</field>
        <field name="model">empowerment.qualification.course</field>
        <field name="arch" type="xml">
            <form>
                <sheet>
                    <group>
                        <field name="name"/>
                    </group>
                </sheet>
            </form>
        </field>
    </record>

    <!-- Action -->
    <record id="action_qualification_course" model="ir.actions.act_window">
        <field name="name">دورات التأهيل</field>
        <field name="res_model">empowerment.qualification.course</field>
        <field name="view_mode">tree,form</field>
    </record>

    <!-- Training Entity Views -->
    <record id="view_empowerment_training_entity_tree" model="ir.ui.view">
        <field name="name">empowerment.training.entity.tree</field>
        <field name="model">empowerment.training.entity</field>
        <field name="arch" type="xml">
            <tree>
                <field name="name"/>
            </tree>
        </field>
    </record>

    <record id="view_empowerment_training_entity_form" model="ir.ui.view">
        <field name="name">empowerment.training.entity.form</field>
        <field name="model">empowerment.training.entity</field>
        <field name="arch" type="xml">
            <form string="جهات التدريب">
                <sheet>
                    <group>
                        <field name="name"/>
                    </group>
                </sheet>
            </form>
        </field>
    </record>

    <record id="action_empowerment_training_entity" model="ir.actions.act_window">
        <field name="name">جهات التدريب</field>
        <field name="res_model">empowerment.training.entity</field>
        <field name="view_mode">tree,form</field>
    </record>

    <record id="view_empowerment_project_funding_type_tree" model="ir.ui.view">
        <field name="name">empowerment.project.funding.type.tree</field>
        <field name="model">empowerment.project.funding.type</field>
        <field name="arch" type="xml">
            <tree>
                <field name="name"/>
            </tree>
        </field>
    </record>

    <record id="view_empowerment_project_funding_type_form" model="ir.ui.view">
        <field name="name">empowerment.project.funding.type.form</field>
        <field name="model">empowerment.project.funding.type</field>
        <field name="arch" type="xml">
            <form>
                <sheet>
                    <group>
                        <field name="name"/>
                    </group>
                </sheet>
            </form>
        </field>
    </record>

    <record id="action_empowerment_project_funding_type" model="ir.actions.act_window">
        <field name="name">أنواع تمويل المشاريع</field>
        <field name="res_model">empowerment.project.funding.type</field>
        <field name="view_mode">tree,form</field>
    </record>

    <!--    inherit department-->


    <record id="view_hr_dep_form_inherit_empowerment" model="ir.ui.view">
        <field name="name">hr.department.form.empowerment</field>
        <field name="model">hr.department</field>
        <field name="inherit_id" ref="hr.view_department_form"/> <!-- Adjust ref to actual base form -->
        <field name="arch" type="xml">
            <xpath expr="//field[@name='analytic_account_id']" position="after">

                <field name="service_link_id" readonly="1"  />

            </xpath>
        </field>
    </record>





    <!-- Menu -->
    <menuitem id="menu_empowerment_root" name="Empowerment Management" groups="odex25_empowermentmanagement.group_emp_social_specialist" web_icon="odex25_empowermentmanagement,static/description/icon.png" />

    <menuitem id="menu_services_settings" name="Services Settings" parent="menu_empowerment_root" sequence="10"/>
    <menuitem id="menu_education_entities" name="Educational Entities" parent="menu_empowerment_root" sequence="20"/>

    <!-- Link Actions -->

    <menuitem id="menu_education_entities_action" name="Educational Entities" parent="menu_education_entities" action="action_empowerment_education_entity" sequence="10"/>
    <menuitem id="menu_education_sp_action" name="Study Specialization" parent="menu_education_entities" action="action_study_specialization" sequence="11"/>
    <menuitem id="menu_action_qualification_course" name="Qualification Courses" parent="menu_education_entities" action="action_qualification_course" sequence="13"/>
    <menuitem id="menu_action_empowerment_training_entity" name="Training Entities" parent="menu_education_entities" action="action_empowerment_training_entity" sequence="14"/>
    <menuitem id="menu_action_empowerment_project_funding_type" name="Project Funding Types" parent="menu_education_entities" action="action_empowerment_project_funding_type" sequence="15"/>

</odoo>
