Skip to Content
Menu
This question has been flagged

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?

Avatar
Discard
Best Answer

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.

Avatar
Discard
Related Posts Replies Views Activity
0
Feb 25
463
0
Jan 25
582
1
Jan 25
506
0
May 25
214
1
Apr 25
281