Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I have a local installation of OpenERP 7 on a windows machine. I have installed it via the latest All-in-one exe. On my machine, I have multiple versions of Python installed (2.7, 3.3).
Is there a way to tell OpenERP which version to use after installation?
(Like there is the line #!/usr/bin/python2.6 in /usr/bin/openerp-server)
I'am porting CalDAV module to version 7.0.
When I try to install the module, I get an ImportError:
File "C:\Program Files (x86)\OpenERP 7.0-20141104-021038\server\openerp\addons\document_webdav\webdav.py", line 40, in <module>
ImportError: No module named DAV
The CalDAV module has document_webdav dependency. Checking line 40 in webdav.py shows:
36: from pywebdav.lib import utils
37: from pywebdav.lib.propfind import PROPFIND
38: from pywebdav.lib.report import REPORT
39: except ImportError:
40: from DAV import utils
41: from DAV.propfind import PROPFIND
42: from DAV.report import REPORT
So I tried to install DAV for Python. Which failed: module not found.
Next I treid to install PyWebDav for Python. Success. For both version 2.7 and 3.3.
Trying to install my CalDAV module threw the same error.
Opening Python console and importing pywebdav works for both versions. "from pywebdav.lib import utils" works for 2.7 and fails for 3.3 ...
So I naively thought my OpenERP server would use python 3.3 instead of 2.7 ...
After Med Said BARA's answer I checked my openerp/server folder. pywebdav 0.9.8 module is existing. But yet the quoted try/except block from above tries to import DAV... Why?
Installed PyDAV for python 2.7.
Copied the new module "WebDAV" to my openerp/server folder.
Still the same ImportError on module installation. Since the module is 'WebDAV' not 'DAV'. And WebDAV has no utils, REPORT, PROPFIND anyway...
I think I finally understand the quoted try-except-block. The try is for pywebdav 0.9.8 while the except is for older pywebdav versions, that have the DAV / DAVSERVER folder structure, instead of the lib.
But still, I have pywebdav 0.9.8 installed. It should work!
Under Windows OpenERP 7 use his own python 2.7, take a look under ../Program Files (x86)/OpenERPxx/server/.. (or where you have installed OpenERP).
Lines added after comment from René Schuster
This is probably due to a missing external dependency in OpenERP (a Python dependency).
What you should do: is to download The_related_Package for the Version 2.7 (preferably a windows auto-install package - see at http://www.lfd.uci.edu/~gohlke/pythonlibs/ if you can find it or by using easy_install) and Install the package. After install you can find this package under X:\Python27\Lib\site-packages\ , copy "The_related_Package" folder from X:\Python27\Lib\site-packages\The_related_Package to Y:\Program Files (x86)\OpenERP xx\server\. This way OpenERp will find the external dependency when needed.
Let's resume: I think that your PYTHONPATH variable is pointing to the 3.3 Python folder, you have to change it to point to the 2.7
Reinstall PyDAV ..... and copy the DAV folder as described before
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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 11/13/14, 4:48 AM|
|Seen: 5172 times|
|Last updated: 3/16/15, 8:10 AM|