Skip to Content
Menu
This question has been flagged
4 Replies
4603 Views

Hi,

I am a beginnier and i am working on the online tutorial to learn how to build a module:

"Technical training - Backend developement ---- Build an Odoo Module';

but for some reasons i can't see my model 'Course' in my module.... I tried to write again from the beginning all the models.py and the openacademy.xml but it's not working...


I asked to one of my developer friend, but he can't find the problem....

-----

Edit :

More informations:

- I use Odoo 13 and deploy on Odoo.sh

- My module is installed and upgrade

-xml is called  in __manifest__ 'data'

- models is imported in __init__

- The problem seems to come from my xml cause i found my model in settings/technical/models

------


If somebody can help me please, here is my files :


openacademy.xml


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


<odoo>


    <record model="ir.ui.view" id="course_form_view">

        <field name="name">course.form</field>

        <field name="model">openacademy.course</field>

        <field name="arch" type="xml">

            <form string="Course Form">

                <sheet>

                    <group>

                        <field name="name"/>

                        <field name="responsible_id"/>

                    </group>

                    <notebook>

                        <page string="Description">

                            <field name="description"/>

                        </page>

                        <page string="Sessions">

                            <field name="session_ids">

                                <tree string="Registered sessions">

                                    <field name="name"/>

                                    <field name="instructor_id"/>

                                </tree>

                            </field>

                        </page>

                        <page string="About">

                        </page>

                    </notebook>

                </sheet>

            </form>

        </field>

    </record>

    

    <record model="ir.ui.view" id="course_tree_view">

        <field name="name">course.tree</field>

        <field name="model">openacademy.course</field>

        <field name="arch" type="xml">

            <tree string="Course Tree">

                <field name="name"/>

                <field name="responsible_id"/>

            </tree>

        </field>

    </record>

    

    <record model="ir.ui.view" id="course_search_view">

        <field name="name">course.search</field>

        <field name="model">openacademy.course</field>

        <field name="arch" type="xml">

            <search>

                <field name="name"/>

                <field name="description"/>

            </search>

        </field>

    </record>

    

    <record model="ir.actions.act_window" id="course_list_action">

        <field name="name">Courses</field>

        <field name="res_model">openacademy.course</field>

        <field name="view_mode">tree,form</field>

        <field name="help" type="html">

            <p class="nocontent">Create the first course

            </p>

        </field>

    </record>

    

    <menuitem id="main_openacademy_menu" name="Open academy"/>

    <menuitem id="openacademy_menu" name="Open Academy"

             parent="main_openacademy_menu"/>

    <menuitem id="courses_menu" name="Courses" parent="openacademy_menu"

              action="openacademy.course_list_action"/>

    

    <record model="ir.ui.view" id="session_form_view">

        <field name="name">session.form</field>

        <field name="model">openacademy.session</field>

        <field name="arch" type="xml">

            <form string="Session Form">

                <sheet>

                    <group>

                        <group string="General">

                            <field name="course_id"/>

                            <field name="name"/>

                            <field name="instructor_id"/>

                            <field name="active"/>

                        </group>

                        <group string="Schedule">

                            <field name="start_date"/>

                            <field name="duration"/>

                            <field name="seats"/>

                            <field name="taken_seats" widget="progressbar"/>

                        </group>

                        <label for="attendee_ids"/>

                        <field name="attendee_ids"/>

                    </group>

                </sheet>

            </form>

        </field>

    </record>

    

    <record model="ir.ui.view" id="session_tree_view">

        <field name="name">session.tree</field>

        <field name="model">openacademy.session</field>

        <field name="arch" type="xml">

            <tree string="Session Tree" decoration-info="duration&lt;5" decoration-danger="duration&gt;15">

                <field name="name"/>

                <field name="course_id"/>

                <field name="duration" invisible="1"/>

                <field name="taken_seats" widget="progressbar"/>

            </tree>

        </field>

    </record>

    

    <record model="ir.actions.act_window" id="session_list_action">

        <field name="name">Sessions</field>

        <field name="res_model">openacademy.session</field>

        <field name="view_mode">tree,form</field>

    </record>

    

    <menuitem id="session_menu" name="Sessions"

              parent="openacademy_menu"

              action="session_list_action"/>

</odoo>

Avatar
Discard
Best Answer

Hi,

If you are saying that the module is not listed under the apps menu, make sure the following scenarios

  1. manifest file is added for the module,

  2. module is placed inside the addons path

  3. service is restarted and updated the apps list before searching the module

  4. Apps filter is removed when searching the apps

If you confirm the above things the newly added module will be listed under the apps menu.


If you are new to odoo development, check out this tutorials:

  1. Odoo 12 Development Tutorials

  2. Odoo 13 Development Tutorials

  3. Odoo 14 Development Tutorials


Thanks

Avatar
Discard
Author

thanks for your answer.

To be more specific, i am working on the Odoo 13 online tutorial, i built my module, he is listed, installed and upgraded.

In the tutorial, i had to create the first class called 'Course', and this one doesn't appear in my module... Further in the tutorial i had to create a new model in a .py and a new view for this one in a .xml and this one appear in my module...

That's why i'm lost... It worked for the last model, but no the first called 'Course'....

sure that the file containing the first class is imported in the init file ?

also switch to super user mode and confirm, might be access rights issue

Author

Yes cool ! The problem was a rights access...Thank you so much. I'm sorry but it seems that i need to have more karma to convert your answer as response.

Related Posts Replies Views Activity
1
Aug 23
1175
1
Jul 23
1159
1
Mar 19
2359
1
Mar 15
6070
1
Mar 15
12380