Odoo Help


[v8] what does the error message "No module named xyz" mean?

on 10/28/14, 11:22 PM 1,523 views

I have a custom Module that adds functionality to Instant Messaging [im_chat]. And naturally my module depends on [im_chat] being installed.

Eventhough [im_chat] is installed, still I get an error message when I want to install my Module [im_chat_history] that somewhat implies [im_chat] was not installed

2014-10-23 13:20:39,427 1691 CRITICAL odoo-8_test openerp.modules.module: Couldn't load module im_chat_history
2014-10-23 13:20:39,427 1691 CRITICAL odoo-8_test openerp.modules.module: No module named im_chat

I have an __init__.py in my Module that imports the im_chat Module


import im_chat

And it looks to me (having no skills of coding and/or python) odoo fails to do that (importing im_chat).

Does anybody has a hint, what could be wrong here?


============== the code =======================



from openerp.osv import fields,osv

class im_history(osv.osv):
    _inherit = 'im.message'





<?xml version="1.0" encoding="utf-8"?>
      <record id="view_im_history" model="ir.ui.view">
        <field name="name">im.message.tree</field>
        <field name="model">im.message</field>
        <field name="arch" type="xml">
                <tree string="IM">
                    <field name="date"/>
                    <field name="from_id"/>
                    <field name="to_id"/>
                    <field name="message"/>

      <!-- Top menu item -->
        <menuitem name="IM"

        <record id="open_view_im_history" model="ir.actions.act_window">
            <field name="name">Instant messaging history</field>
            <field name="res_model">im.message</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree</field>
            <field name="view_id" ref="view_im_history"/>

        <menuitem name="Actions" id="im_history" parent="im_history_root" groups="base.group_user"/>
        <menuitem action="open_view_im_history" id="menu_open_view_im_history" parent="im_history" sequence="20" groups="base.group_user"/>




import im




    "name" : "Instant messaging history",
    "version" : "1.1",
    "author" : "L",
    "category" : "Generic Modules/Messaging",
    "website" : "-",
    "description": "Adds history view to instant messaging module.",
    "depends" : ["im_chat"],
    "init_xml" : [],
    "update_xml" : ["im_view.xml"],
    "installable": True


I had some similar errors with custom modules while putting the python dependencies at __openerp__.py Removing those dependencies from __openerp__.py fixed the problem for me. Hope it could help you too.. Cheers

Alejandro Perez Cosio
on 10/28/14, 11:44 PM

apparently that was not it. Removed a line that lists the dependency of [im_chat] but still get the same error File "/opt/odoo/odoo-server/addons-custom/im_chat_history/__init__.py", line 1, in import im_chat ImportError: No module named im_chat

on 10/29/14, 12:41 AM

Ludo - 21South

--Ludo - 21South--
| 2 2 5
Zwijndrecht, Netherlands
--Ludo - 21South--


Ludo - 21South
On 10/29/14, 4:28 AM

In contrary to regular python, importing other Odoo modules is done using the __openerp__.py file. Remove the "import" line from your __init__.py file. Only add to that file the actual python files in your custom module directory, nothing else.

Instead, edit the __openerp__.py file and find the key "depends". In a list, sum up all the modules by their directory name that you require from Odoo to work.

For example:
"depends": ['account', 'sale', 'im_chat']

thanks, that helped with the "No Module named 'xy'" Problem. Now I am getting a " KeyError: 'im.message' " . I find the string 'im.message' in two of my Module's files: 1. 'im_view.xml' & 2. 'im.py'. I have posted the code in my Question above for reference

on 10/29/14, 5:58 PM

In my current Odoo version there is no im.message in the source code. There is however a "im_chat.message" available. Check if this is the class you require OR the model is in a different Odoo module.

21south, Ludo - 21South
on 10/30/14, 4:07 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 10/28/14, 11:22 PM
Seen: 1523 times
Last updated: 3/16/15, 8:10 AM