Odoo Help

Welcome!

This community 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.

0

File not found module_name error

By
bogdan baltatu
on 10/9/13, 7:06 AM 1,185 views

hello I have a strange error and I do not know what's causing this error. My code is:

___init__.py

import project_extended

__openerp___.py

{
'name': 'project_extended',
'version': '1.0',
'category': 'Generic Modules/Others',
'description': " Project object extend"
    'author': 'bogdan @ nvncompany.ro',
'depends': ['base',"project","project_issue",],
'data': [
    '',
],
'installable': True,
'auto_install': False,
}

prokect_extended.py

from openerp.osv import fields, osv

class extended_project_issue_version(osv.osv):
_name = "project.issue.version"
_inherit = "project.issue.version"
_columns = {
    'company_id': fields.many2one('res.company', 'Company'),
}
_defaults = {
    'company_id': lambda self, cr, uid, ctx=None: self.pool.get('res.company')._company_default_get(cr, uid, 'project.task', context=ctx),
}   
extended_project_issue_version()    

class extended_project_phase(osv.osv):
_name = "project.phase"
_inherit = "project.phase"
_columns = {
    'company_id': fields.many2one('res.company', 'Company'),
}
_defaults = {
    'company_id': lambda self, cr, uid, ctx=None: self.pool.get('res.company')._company_default_get(cr, uid, 'project.task', context=ctx),
}
extend_project_phase()

class extend_project_category(osv.osv):
_name = "project.category"
_inherit = "project.category"
_columns = {
    'company_id': fields.many2one('res.company', 'Company'),
}
_defaults = {
    'company_id': lambda self, cr, uid, ctx=None: self.pool.get('res.company')._company_default_get(cr, uid, 'project.task', context=ctx),
}
extend_project_category()
0

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 10/9/13, 7:45 AM

Hello,

It seems like error of importing .py file.

Make sure the .py file imported in the __init__.py is existing in the model.

Thanks and Regards,

Serpent Consulting Services

Thank you. I slove the problem. My module name was "project_extended7" and in _init__.py was import "project_extend".

bogdan baltatu
on 10/9/13, 7:57 AM

I import corect module but I have a new error :RuntimeError: maximum recursion depth exceeded in cmp openerp

bogdan baltatu
on 10/9/13, 8:09 AM

In __init__.py you need to import the python file project_extended.py that is inside the module, not the module itself, that's why you are getting a recursion error.

IBS
on 10/9/13, 10:41 AM

Can you tell me how can i import onli the file project_extended.py?

bogdan baltatu
on 10/9/13, 12:20 PM

put import project_extended in __init__.pyand restart your server.

IBS
on 10/9/13, 12:21 PM
0
bogdan baltatu
On 10/9/13, 12:41 PM

In first post I put __init__.py file and my file have "import project_extended" but does not work. I restart server everty time when I install a new module but i think OpenERP cache some information. Now I rename module folder on new installation but i think it's not a good ideea.

In this moment I restart the server I have "project_extended" folder on OpenERP Addons directory, in __init__.py I have "import project_extended" and all code from my first post and error is "IOError: File not found: project_extended\" I look in "Apply scheduled upgrades from "Modules" and it's only "project_extended" module (not project_extend7 or others".

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 10/9/13, 7:06 AM
Seen: 1185 times
Last updated: 3/16/15, 8:10 AM