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


[options]
without_demo = False
smtp_port = 25
db_password = openpgpwd (password you had given for the new role created in postgresql)
xmlrpcs_interface =
syslog = False
logrotate = True
xmlrpcs_port = 8071 (change port here if already allinone setup has been installed,say 8061)
test_report_directory = False
list_db = True
timezone = False
xmlrpc_interface =
test_file = False
cache_timeout = 100000
smtp_password = False
secure_pkey_file = server.pkey
xmlrpc_port = 8069 (change port here if already allinone setup has been installed,say 8059)
log_level = info
xmlrpc = True
test_disable = False
admin_passwd = admin
assert_exit_level = error
smtp_server = localhost
static_http_url_prefix = None
test_commit = False
xmlrpcs = True
demo = {}
login_message = False
import_partial =
pidfile = None
db_maxconn = 64
stop_after_init = True
osv_memory_count_limit = False
reportgz = False
osv_memory_age_limit = 1.0
netrpc_port = 8070 (change port here if already allinone setup has been installed,say 8060)
db_port =5432 (change port value as given by you at the time of postgresql-9.0 installation)
db_name = False
debug_mode = False
netrpc = True
secure_cert_file = server.cert
csv_internal_sep = ,
pg_path = None
static_http_enable = False
translate_modules = ['all']
smtp_ssl = False
root_path = C:\OpenERP\server (change root_path to where you have extracted OpenERP Server)
netrpc_interface =
smtp_user = False
db_user = openpg (new login role you have created in postgresql)
db_host =localhost
email_from = False
addons_path = C:\OpenERP\server\bin\addons (change addons_path to addons directory present in root_path )
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.
         

Comments

Vincent: 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: Unresolved import: fields a1_test.py /Openerp-6.1/openerp/addons/a1/wizard line 0 PyDev Problem 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 ".

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. HAI Pham says:

    That’s great
    However I think you should put the full name of configuration file in step 9 (openerp-server.conf)
    And the zip file in step 3 is dead, please update
    Regards,

    1. fahad says:

      Hi HAI Pham,

      Thanks for the comment posted. I have updated the link please check it now, it will be working.
      Sorry for the trouble.

       

      Regards,

      Fahad
       

      1. Newbie :( says:

        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

        1. Clement says:

          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?

          1. fahad says:

            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

                             

             

          2. clement says:

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

      2. Asim says:

        Unfortunately i an unable to create database, i follow all the steps as documented on this page with same versions for postgres, python and openerp server.
        After start openerp-server.py and openerp-web.py from Eclipse and when start to create database received below error
        [2012-02-08 13:37:04,530][template1] INFO:web-services:CREATE DATABASE: demodb
        [2012-02-08 13:37:08,405][demodb] ERROR:web-services:[01]: CREATE DATABASE
        [2012-02-08 13:37:08,405][demodb] ERROR:web-services:[02]: Traceback (most recent call last):
        [2012-02-08 13:37:08,405][demodb] ERROR:web-services:[03]: File “C:\OpenERP\openerp-server\bin\service\web_services.py”, line 95, in __call__
        [2012-02-08 13:37:08,405][demodb] ERROR:web-services:[04]: tools.init_db(cr)
        [2012-02-08 13:37:08,405][demodb] ERROR:web-services:[05]: File “C:\OpenERP\openerp-server\bin\tools\misc.py”, line 79, in init_db
        [2012-02-08 13:37:08,405][demodb] ERROR:web-services:[06]: for i in addons.get_modules():
        [2012-02-08 13:37:08,405][demodb] ERROR:web-services:[07]: File “C:\OpenERP\openerp-server\bin\addons\__init__.py”, line 306, in get_modules
        [2012-02-08 13:37:08,405][demodb] ERROR:web-services:[08]: plist.extend(listdir(ad))
        [2012-02-08 13:37:08,405][demodb] ERROR:web-services:[09]: File “C:\OpenERP\openerp-server\bin\addons\__init__.py”, line 302, in listdir
        [2012-02-08 13:37:08,405][demodb] ERROR:web-services:[10]: return map(clean, filter(is_really_module, os.listdir(dir)))
        [2012-02-08 13:37:08,405][demodb] ERROR:web-services:[11]: WindowsError: [Error 2] The system cannot find the path specified: u’C:\\OpenERP\\openerp-server\\addons\\*.*’
        and for loging page database name in dropdown list is appears like “x64656d6f” where as in pgadminIII interface database is created with actual “demodb” name.
        Regards,
        Asim

        1. fahad says:

          Hi,

          Database creation issue might be due to the openerp configuration file.please check the configuration file.Database name issue can be solved using the following .

          1. Edit postgresql.conf (which is located in the data folder of the postgresql installation)
          2. Modify line to:
          bytea_output = 'escape'
          3. Restart postgresql server.

          Regards,
          fahad

          1. Asim says:

            Hi Fahad,
            Database name issue resolved, but still unable to create database.
            I tried
            -c config-file
            -update all
            in run configurations but no success.
            stuck here 🙁
            Regards,
            Asim

          2. Asim says:

            H Fahad,
            Find out that there are lots of red marks for import commands
            e.g. below are the unresolved imports in
            openerp-server\bin\service\web_services.py
            from tools.translate import _
            import addons
            import ir
            import netsvc
            import pooler
            import release
            import sql_db
            import tools
            this might be the reason?
            regards,
            Asim

          3. fahad says:

            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

          4. Asim says:

            My email id is asimdeo@gmail.com
            I have installed teamviewer, so email me ur availibility
            Regards,
            Asim

          5. benabdessamed says:

            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

          6. Vincent says:

            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:

            Unresolved import: fields a1_test.py /Openerp-6.1/openerp/addons/a1/wizard line 0 PyDev Problem
            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

        2. fahad says:

           

          Hi Asim,

          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

                           
           

  2. Newbie :( says:

    Could you write an Ubuntu Development Enviorment much similar to the one above.
    With baby steps for mewbie like me? I been trying to figure it out for sometime.There isn’t much info for me to grasp on.
    IT would be very much appreciated!
    Thanking you very much!
    Newbie!

    1. chat with friends says:

      I think that is one of the most vital information for me. And i'm satisfied studying your article. However wanna observation on some basic things, The site style is great, the articles is in reality excellent : D. Excellent job, cheers

  3. Muhammad Fahim says:

    AA – Jazakallah. A wonderful, informative and detailed document amazing. I did not yet started to check the development environment either in Windows or Linux but planing to do so in near future. I have a question about you comment can you please give more detail why the Ubunto is a better platform then Windows either it is functionally or technically or it is a personal choice. It is very important because I am deciding to develop and to chose the platform.
    Onece again awesome.
    Regards,
    MFA

    1. fahad says:

      Hi,

      This link might help you in clearing out the points. 

      http://www.openerp.com/forum/topic13195.html

       

      Regards,
      fahad

      1. Muhammad Fahim says:

        Hi,
        Thanks, so most of the production deployment is on Linux rather than Windows.
        Regards,
        MFA

        1. marik Sharma says:

          this is a wonderful thing to know "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"..thanks for informing me in advance…

          1. HaroldPrice says:

            It’s a good piece of information. High intensity content and it is presented in a good manner. Hopefully waiting for your next post. Best essay writing service UK

  4. Mirco says:

    Hi Fahad,
    i followed your tutorial and all seems went well..
    But i have issues on import any class / package related to openerp, like import osv.
    To create a new openerp module , in server project i create a new pyDev package located in bin.addons.name_of_module.is this the right way?
    Can you please help me?
    Thanks

  5. romar says:

    Hi Fahad,
    I have a question. After setting up the development environment on Windows, do I still need to have a Linux environment to build the libraries? I found this here (http://doc.openerp.com/v6.0/developer/8_24_build/index.html), but I am pretty sure I am misunderstanding something.
    Thanks in advance for your help!

    1. fahad says:

      Hi Romar,

      Links contains guide how to build exe of openerp server. that is we can build the exe from source code of openerp server which can be customized as per our need.Openerp provides exe for download of the stable version. we can create the exe of development version from the link above.

      Regards,
      fahad

  6. jeny says:

    Hi i have imported open erp in eclipse in windows. When i try to debug the client an import error “No module named pygtk” is occurring. Hope you would help me.

  7. anonymous says:

    i want to change modul res.partner but openerp takes no chnges.
    example : add fields.
    i work in windows xp.

    1. fahad says:

      After adding the fields. Please restart the openerp-server and if not still been updated.Please schedule upgrade the module.

  8. Anonymous says:

    I follow the steps, when i lunch a debug i have a problems :
    I dont understand why i have this problem :'( :
    Traceback (most recent call last):
    File “C:\Users\slim.slim-PC\Desktop\eclipse\plugins\org.python.pydev_2.6.0.2012062818\pysrc\pydevd.py”, line 1392, in
    debugger.run(setup[‘file’], None, None)
    File “C:\Users\slim.slim-PC\Desktop\eclipse\plugins\org.python.pydev_2.6.0.2012062818\pysrc\pydevd.py”, line 1085, in run
    pydev_imports.execfile(file, globals, locals) #execute the script
    File “C:\OpenErp\openerp-server-6.0.3\bin\openerp-server.py”, line 112, in

    service.http_server.init_servers()
    File “C:\OpenErp\openerp-server-6.0.3\bin\service\http_server.py”, line 233, in init_servers
    int(tools.config.get(‘xmlrpc_port’, 8069)))
    ValueError: invalid literal for int() with base 10: ‘8069 (change port here if already allinone setup has been installed,say 8059)’
    help me please :'(

    1. fahad says:

      Please remove the round brackets and their contents, which was meant only for understanding.

  9. Rami says:

    Hi Fahad,
    Thanks for the great article .. I need your help to get the server and the client running without eclipse on windows.
    What would be the command to do that.
    Thanks,
    Rami

    1. fahad says:

      Hi Rami,

      1)Use commanfd line and cd to directory of the server.
      2)Openerp Server could be started using python openerp-server.py

       

  10. pfe2013 says:

    hi, I want to install Openerp-server (6.0.3) on windows with source. i have already download all python packages; but when I execute
    Code: python setup.py install
    I have this error: Code:
    Traceback (most recent call last):
    File “C:\serveur\openerp-server-6.0.3\setup.py”, line 269, in
    z = zipfile.ZipFile(zipfile_path, ‘a’)
    File “C:\Python25\lib\zipfile.py”, line 339, in __init__
    self.fp = open(file, modeDict[mode])
    IOError: [Errno 2] No such file or directory: ‘dist\\library.zip’
    thanks

  11. PFE says:

    Hi
    After setting up the development environment on Windows,
    when I come to execute openerp-server.py:
    error:
    [2013-03-04 11:10:10,776][?] INFO:server:OpenERP version – 6.0.3
    [2013-03-04 11:10:10,776][?] INFO:server:addons_path – C:\openerp-server-6.0.3\bin\addons
    [2013-03-04 11:10:10,776][?] INFO:server:database hostname – localhost
    [2013-03-04 11:10:10,776][?] INFO:server:database port – 5432
    [2013-03-04 11:10:10,776][?] INFO:server:database user – Hamdi
    [2013-03-04 11:10:10,776][?] INFO:server:initialising distributed objects services
    Traceback (most recent call last):
    File “C:\openerp-server-6.0.3\bin\openerp-server.py”, line 94, in
    import report
    File “C:\openerp-server-6.0.3\bin\report\__init__.py”, line 22, in

    import interface
    File “C:\openerp-server-6.0.3\bin\report\interface.py”, line 32, in

    import render
    File “C:\openerp-server-6.0.3\bin\report\render\__init__.py”, line 22, in

    from simple import simple
    File “C:\openerp-server-6.0.3\bin\report\render\simple.py”, line 27, in

    from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table
    ImportError: No module named reportlab.platypus
    thanks

  12. pfe2013 says:

    hi, I want to install Openerp-server (6.0.3) on windows with source. i have already download all python packages; but when I execute
    Code: python setup.py install
    I have this error:
    File “C:\serveur\openerp-server-6.0.3\setup.py”, line 269, in
    z = zipfile.ZipFile(zipfile_path, ‘a’)
    File “C:\Python25\lib\zipfile.py”, line 339, in __init__
    self.fp = open(file, modeDict[mode])
    IOError: [Errno 2] No such file or directory: ‘dist\\library.zip’

  13. Titus says:

    I have followed the steps to have openERP on my machine. When I run opeerp-server.py I get this output:
    [2013-04-17 15:09:27,352][?] INFO:server:OpenERP version – 6.0.4
    [2013-04-17 15:09:27,352][?] INFO:server:addons_path – C:\OpenERP\Server\bin\addons
    [2013-04-17 15:09:27,352][?] INFO:server:database hostname – localhost
    [2013-04-17 15:09:27,352][?] INFO:server:database port – 5432
    [2013-04-17 15:09:27,352][?] INFO:server:database user – Titus
    [2013-04-17 15:09:27,352][?] INFO:server:initialising distributed objects services
    [2013-04-17 15:09:27,634][?] INFO:web-services:starting HTTP service at 0.0.0.0 port 8069
    [2013-04-17 15:09:27,635][?] INFO:web-services:starting HTTPS service at 0.0.0.0 port 8071
    [2013-04-17 15:09:27,635][?] INFO:web-services:Registered XML-RPC over HTTP
    [2013-04-17 15:09:27,638][?] INFO:web-services:starting NET-RPC service at 0.0.0.0 port 8070
    [2013-04-17 15:09:27,638][?] INFO:server:Starting 3 services
    [2013-04-17 15:09:27,640][?] INFO:server:OpenERP server is running, waiting for connections…
    When I run the openerpclient I get errors as follows
    Traceback (most recent call last):
    File “C:\OpenERP\Client\bin\openerp-client.py”, line 62, in
    import gtk
    File “C:\Python25\Lib\site-packages\gtk-2.0\gtk\__init__.py”, line 38, in

    import gobject as _gobject
    File “C:\Python25\Lib\site-packages\gtk-2.0\gobject\__init__.py”, line 30, in

    from gobject.constants import *
    File “C:\Python25\Lib\site-packages\gtk-2.0\gobject\constants.py”, line 22, in

    from _gobject import type_from_name
    ImportError: DLL load failed: The specified module could not be found.
    Kindly help

  14. Anonymous says:

    I want to design forms in my project . How can I be able to do this ?
    Please help

  15. Khin says:

    I installed OpenERP7 (Allinone),Python25, Eclipse(Indigo) in Window XP. Now I want to customize some feature in existing module (hr_payroll).I can’t debug OpenERP in Eclipse. I didn’t find this file (openerp-server.py) in my location(C:\Program Files\OpenERP 7.0-20130613-231107\Server\server\..). In Eclipse, I didn’t see server folder in browse (Eclipse -> Run -> Debug Configurations -> Python Run -> Double click -> Browse). Can you help me this problem? Thank you very much.

© 2020 Zesty Beanz Pvt Ltd All Rights Reserved.