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

Hi I am using Win 7 with eclipse IDE along with Python . I have created a custom module for openerp 7. My module updated successfully and it is in the openerp module list . Now I am trying to add fields in my module , but when I try to declare fields I am facing an error ( " ImportError: No module named openerp.osv ") . How to overcome this issue ? Please help

Hopes for suggestion . Thanks

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

im also creating simple modules for openERP v 7.0 until i encountered this problem in Odoo v8.0 (former openERP), i solved this problem by changing the traditional syntax for import  from  from osv import fields,osv   to    from openerp.osv import osv, fields     and make sure in your __init__.py   to remove the extension ".py" , example   import student  not import student.py    .... this works for me, i hope this will also work for you.

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

Hi Arsalan, Try,

from openerp.osv import fields, osv

class your_class_name(osv.Model):

Hope it work for you.

Аватар
Відмінити
Автор

Thanks but it didnot work . Am I making any configuration mistake or should I use some other IDE for running my code. I am a bit worried about this issue. Please help

Найкраща відповідь

I think the correct import statement dependent on the revision of openerp v7. If you use an older revision , you could try "from osv import fields, osv" as stated in the technical memento of openerp v7.

Аватар
Відмінити
Автор

I have tried " from osv import fields , osv" but still the same issue , Do me a favour , tell me about the configuration because may be it is some configuration issue

Найкраща відповідь

How did you solve this problem? I have same problem. my openerp-server on eclipse but I get the error when I debug addons modules. I'm quite sure is eclipse configuration. googled all over but people assume once openerp-server start on eclipse then people will be able to debug modules. that is completely wrong. you get this ImportError: No module named openerp.osv that many tutorials do not address. I'm still to see a tutorial on eclipse debug that works without people raising this issue

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
вер. 23
7711
2
бер. 23
46784
2
груд. 23
57701
0
бер. 22
2383
3
черв. 20
10688