Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
1061 Переглядів

Hello.

 I am trying to import a module on to my database in Odoo.com. I've entered everything correctly and verified the files and there's no problems in the code. However, when I try to import the module, I get errors regarding the model I'm linking the XML views to.

For example:


Error while importing module 'my_module'. 

    while parsing /tmp/tmpg3vj2tty/my_module/views/my_module_menus.xml:4, somewhere inside <menuitem id="my_module_submenu" name="Module Menu" parent="my_module_menu" action="my_module_action" sequence="2"/>  


and:


while parsing /tmp/tmpsrcr391x/my_module/views/my_module_lists.xml:3 Error while validating view near: <list string="My Module" __validate__="1"> <field name="name"/>

Model not found: my.module 

View error context: {'file': '/tmp/tmpsrcr391x/my_module/views/my_module_lists.xml', 'line': 1, 'name': 'my.module.list', 'view': ir.ui.view(3161,), 'view.model': 'my.module', 'view.parent': ir.ui.view(), 'xmlid': 'my_module_list'}  


What's strange about this is that it everything works perfectly fine on my localhost server, which is where I made the module. I think it has something to do with the models but I don't know what could be wrong. How can this be fixed?

Аватар
Відмінити
Найкраща відповідь

Uninstall locally and try re-installing it. I'm quite certain it will not work there either. This behavior can easily occur when you update your module 'as you go' - i.e. installed early in development, changed things around. At one point you have a module that works because it has been installed already early on and views referenced to somewhere else for example are in the database already. 

That being said, check out closely

<menuitem id="my_module_submenu" name="Module Menu" parent="my_module_menu" action="my_module_action" sequence="2"/>

Your menuitem my_module_submenu most likely references the action my_module_action before it is actually defined (-> move the record of my_module_action above the menuitem needing it).

For my_module_lists.xml it's just a guessing game. Post your code at it probably can be solved as well.

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
0
лют. 25
1046
0
січ. 25
1368
1
січ. 25
1038
2
лип. 25
2413
0
трав. 25
769