Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
1080 Lượt xem

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?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 2 25
1064
0
thg 1 25
1378
1
thg 1 25
1048
2
thg 7 25
2442
0
thg 5 25
792