India

ZestyBeanz Technologies Pvt Ltd 4th Floor, Nila, Technopark Thiruvananthapuram,
India – 695581
Phone: +91 471 4063254
Fax : +91 471 2700171

   .

ZestyBeanz Technologies Pvt Ltd
61/3236, Manikkath Cross Road
Ravipuram, Kochi, India - 682016
Phone: +91 484 4063254

  UAE

Zesty Labs
Office # 2003, Millennium Plaza Building
Sheikh Zayed Rd, Dubai, UAE
Phone: +971 4333 2222​
Mobile: +971-52-7553466

  Germany​

ZestyBeanz Technologies GmbH
Reuterstraße 1
90408 Nürnberg
Fon: +49 911 4801 444
Fax: +49 911 4801 445

OpenERP development environment in Windows using Eclipse.

Contact Form


fahad's picture

OpenERP development environment in Windows using Eclipse.

 In this blog we will go through some steps required in setting up OpenERP for customization under eclipse in windows.
Before going into the details, let me remind every one that Linux distros preferably ubuntu is the best platform to do developments in OpenERP. This may be useful to only those insit development to be done in Windows.

Versions Used:

        OpenERP        -      6.0.3
        Postgresql       -      9.0.4 
        Eclipse            -       3.7 (Indigo) 

  1)Download eclipse sdk(Indigo,latest version) and unzip it 
               http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.7-201106131736/eclipse-SDK-3.7-win32.zip

   2)To run eclipse a java based application requires java jre to be installed.Download and install from 
                 http://www.oracle.com/technetwork/java/javase/downloads/index-jdk5-jsp-142662.html
 
        After installation, we need to add the jre bin path into system environment variable PATH.In my case jre bin
         was at 'C:\Program Files\Java\jre1.5.0_22\bin'.similarily add the jre bin path of your installation.
          (My computers-->properties-->Advanced System Setting-->Environment Variable-->PATH)

   3)Download the zip file from here which contains python interpretor and other python packages needed by OpenERP.
       Extract and run the batch file 1 which installs python and  its associated libraries.we need to add following path
       to system environment variable PATH before running the batch file 2 since it requires python as windows
       command to run python scripts to install some more python packages.
(;C:\Python25;C:\Python25\Scripts;C:\Python25\bin;C:\Python25\libs;C:\Python25\Lib\site-packages;C:\Python25\include;C:\Python25\DLLs)
         
         Zip files conatins packages downloaded from the following links
                a)http://bazaar.launchpad.net/~openerp/openerp/win-installer-trunk/files/head%3A/dependencies/
 
               b)http://pyyaml.org/download/pyyaml/PyYAML-3.09.win32-py2.5.exe
 
               c)http://ftp.edgewall.com/pub/babel/Babel-0.9.4.tar.gz
 
               d)http://download.cherrypy.org/cherrypy/3.1.2/CherryPy-3.1.2.tar.gz
 
               e)http://pypi.python.org/packages/source/s/simplejson/simplejson-2.0.9.tar.gz
 
               f)http://pypi.python.org/packages/source/F/FormEncode/FormEncode-1.2.2.tar.gz

    4)Install PyDev plugin in eclipse
              a)help -> Install New Software.
              b)In Install dialog box, Click Add.
              c)Give name ‘pydev’ and type the path. i.e. http://pydev.org/updates.
              d)click ok.
              e)select pydev checkbox and follow the steps by clicking finish

     5)Adding python in eclipse can be done by
             a)window -> Preferences
             b)In Preferences dialog box expand pydev from left side tree
             c)click on Interpreter-Python
             d)click new on right side of python Interpreters
             e)locate the python.exe in the installed path e.g. C:\Python25\python.exe via Browse button and also
                give the name to this interpreter(Python25)
             f)click ok then again ok

      6)Download and unzip tarballs for OpenERP 6.0.3 server, Client and Web-client using the following paths.
         Unzip all these packages to separate folders on same path like Client, Server, Webclient folders in
         C:\OpenERP path.
                  a)http://www.openerp.com/download/stable/source/openerp-server-6.0.3.tar.gz
 
                 b)http://www.openerp.com/download/stable/source/openerp-client-6.0.3.tar.gz
 
                 c)http://www.openerp.com/download/stable/source/openerp-web-6.0.3.tar.gz

       7)Now we need to create PyDev projects in Eclipse for each of three projects i.e. Server, Client, and Webclient.
          we can name the PyDev project as for eg:OpenERPClient, OpenERPServer and OpenERPWebClient and
          for each we have to uncheck the option Use Default and browse for the path where we have unzipped each of 
          packages(C:\OpenERP).we have to choose project type as Python and its grammar version as 2.5 and
          Interpreter as Python 2.5.

       8)Download  and Install postgresql.
             a)http://www.enterprisedb.com/products-services-training/pgdownload#windows
             b)It will prompt for password and port number during installation process .If already postgresql older version
                is runnning on your machine then enter port 5433 else enter 5432.
             c)Create a new postgres user , start-->all programs-->postgresql 9.0-->pgadmin3
             d)servers-->postgresql 9.0 right click on connect and enter password when prompted
             e)mouse over login role right click new login role and enter role name(eg. 'openpg') and password
                (eg. 'openpgpwd') and in the second tab role privileges above check all boxes(Superuser,Can Create....)

        9)Now need to create configuration file for openerp-server with following options and copy conf file  to the bin
          folder located in the path where we’ve unzipped server’s source code e.g. C:\OpenERP\server\bin

  1. [options]
  2. without_demo = False
  3. smtp_port = 25
  4. db_password = openpgpwd           (password you had given for the new role created in postgresql)
  5. xmlrpcs_interface = 
  6. syslog = False
  7. logrotate = True
  8. xmlrpcs_port = 8071               (change port here if already allinone setup has been installed,say 8061)
  9. test_report_directory = False
  10. list_db = True
  11. timezone = False
  12. xmlrpc_interface = 
  13. test_file = False
  14. cache_timeout = 100000
  15. smtp_password = False
  16. secure_pkey_file = server.pkey
  17. xmlrpc_port = 8069                (change port here if already allinone setup has been installed,say 8059)
  18. log_level = info
  19. xmlrpc = True
  20. test_disable = False
  21. admin_passwd = admin
  22. assert_exit_level = error
  23. smtp_server = localhost
  24. static_http_url_prefix = None
  25. test_commit = False
  26. xmlrpcs = True
  27. demo = {}
  28. login_message = False
  29. import_partial = 
  30. pidfile = None
  31. db_maxconn = 64
  32. stop_after_init = True
  33. osv_memory_count_limit = False
  34. reportgz = False
  35. osv_memory_age_limit = 1.0
  36. netrpc_port = 8070                 (change port here if already allinone setup has been installed,say 8060)
  37. db_port =5432                      (change port value as given by you at the time of postgresql-9.0 installation)
  38. db_name = False
  39. debug_mode = False
  40. netrpc = True
  41. secure_cert_file = server.cert
  42. csv_internal_sep = ,
  43. pg_path = None
  44. static_http_enable = False
  45. translate_modules = ['all']
  46. smtp_ssl = False
  47. root_path = C:\OpenERP\server      (change root_path to where you have extracted OpenERP Server)
  48. netrpc_interface = 
  49. smtp_user = False
  50. db_user = openpg                   (new login role you have created in postgresql)
  51. db_host =localhost
  52. email_from = False
  53. addons_path = C:\OpenERP\server\bin\addons  (change addons_path to addons directory present in root_path )      
  54. static_http_document_root = None

      10)In Eclipse package explorer, open the list of Server -> open Bin -> Right Click on openerp-server.py 
        Mouse Over ‘Run As’ -> Select ‘Python Run. In the same manner you can run openerp-client and openerp-web.

    Note : 
        a)IF no other installation of OpenERP are there you can use the default values for netrpc,xmlrpc and xmlrpcs
        b)IF you have changed the netrpc port value then you should also change value of 'openerp.server.port' to 
           corresponding netrpc port value in  web/doc/openerp-web.cfg.
         c)Similarily when trying to connect server with openerp-client also need to change netrpc-port to same.
         

Vincent's picture

I have also unresolved import

I have also unresolved import when I try to debug.

For example, I import fields from osv in my custom module (named a1 in this case).

I got the following pydev error:

  1. Unresolved import: fields	a1_test.py	/Openerp-6.1/openerp/addons/a1/wizard	line 0	PyDev Problem
  2.  
  3. Unresolved import: osv	a1_test.py	/Openerp-6.1/openerp/addons/a1/wizard	line 0	PyDev Problem

I tried your tutorial in windows and in Linux and I have the same issue.

By the way, my module can run without problem: the issue is related to eclipse and the debugger.

Regards,

Vincent

fahad's picture

Hi Asim, I think it would be

Hi Asim,

I think it would be better if you can give team viewer access so that i can look into it and try to fix the error.

 

Regards,
 fahad

benabdessamed's picture

hello I do this steps, but i

hello

I do this steps, but i have this message error :

No handlers could be found for logger "init"
Traceback (most recent call last):
File "D:\openerp6.0\openerp-server-6.0.3\bin\openerp-server.py", line 58, in
import netsvc
File "D:\openerp6.0\openerp-server-6.0.3\bin\netsvc.py", line 292, in
import tools
File "D:\openerp6.0\openerp-server-6.0.3\bin\tools\__init__.py", line 26, in
from convert import *
File "D:\openerp6.0\openerp-server-6.0.3\bin\tools\convert.py", line 49, in
from yaml_import import convert_yaml_import
File "D:\openerp6.0\openerp-server-6.0.3\bin\tools\yaml_import.py", line 11, in
import yaml_tag
File "D:\openerp6.0\openerp-server-6.0.3\bin\tools\yaml_tag.py", line 1, in
import yaml
ImportError: No module named yaml

can some one help me

Asim's picture

My email id is

My email id is [email protected]

I have installed teamviewer, so email me ur availibility

Regards,
Asim

Newbie :('s picture

Great blog!!Very helpful! But

Great blog!!Very helpful!
But as you and many around has suggested that OpenERP is best developed in Ubuntu.
Would you write a blog with baby steps to set up an enviorment in Ubuntu?
It would be very hepful for newbies like me.

Regards ,
Newbie

Clement's picture

Hello! you have done a good

Hello!
you have done a good job; thanks a lot. but i can't connect to the server.
please help me how can i going to do?

fahad's picture

Hi Clement, I think the

Hi Clement,

I think the configuration file is not been taken by from the path so we need to pass the configuration file as argument
while running openerp-server.

         Create a run configurtaion in eclipse with the following steps.
                  1. Run  -- >  run configurtions  -->  python run --> new
                  2. Enter the project,  (select project we created)
                             main module (select openerp-server.py from bin directory).
                             arguements (-c <path to conf file>)   <-- next tab
                             then click apply and then close.
                  3. Goto Run --> Run Configurations --> Python Run
                            Select the created configuration
                             Click Run (Button located at lower right) 
                             OR
                         If previously ran Goto Run --> Run History Select the configuration
                             OR
                         If previously ran, then Console Window will be having control buttons to terminate , start and restart

  Regards,
   fahad

                 

 

clement's picture

good! fahad it's walks. lot

good! fahad it's walks. lot of thanks.