Hello,
I often see modules which are using
import tools
instead of
import openerp.tools
My installation cannot resolve a library without the preceeding "openerp.". I think that this depends on the type of installation and it would not be a problem if a deb-Package is installed.
So my question:
What can I do, than modules without the preceeding "openerp." are working for my installation?
Here is the log of the installation of a module:
File "/opt/openerp/openerp-7.0-bzr/server/openerp/modules/module.py", line 346, in load_openerp_module __import__('openerp.addons.' + module_name) File "/opt/openerp/openerp-7.0-bzr/server/openerp/modules/module.py", line 82, in load_module mod = imp.load_module('openerp.addons.' + module_part, f, path, descr) File "/opt/openerp/addons-elbati/hr_attendance_analysis/__init__.py", line 22, in <module> import hr_attendance File "/opt/openerp/addons-elbati/hr_attendance_analysis/hr_attendance.py", line 24, in <module> from tools.translate import _ ImportError: No module named tools.translate
Hi, for location of your module, did you use same unix user account, same partition disk, it is placed in server/openerp/addons directory, did you use symlink, addons_path option in opeenrp server conf file ? Personnaly by using addons_path option in server conf file I have not this error. Bye
Thanks for your comment. I try to install module "hr_attendance_analysis" of branch "lp:~elbati/hr-timesheet/adding_hr_attendance_analysis_7". all unix permissions are ok. I tried with addons_path, symlink and direct copy into /server/openerp/addons path without success. I am starting the server in the server directory with
./openerp-server -c /etc/openerp-server-7.conf
Hi, with openerp 7 it seems it is now openerp.tools ... which is used. But try to add ..../server/openerp path to pythonpath (search on google how to deine multi path for pythonpath). Should works (I believe deb package installs openerp in python site-packages directory, in this case no problme to find libraries python). Bye