3
votes

I downloaded Open ERP server & web, having decided against the thicker gtk. I added the 2 as projects in eclipse, pydev running on Ubuntu 11.10 and started then up. I went through the web client setup & I though the installation had been done. At some point though I had executed a script that tried to copy all the bits and pieces out of my home folder into the file system some going to /ect or usr/local. I didn't want this so I stopped the process. Cause then I though I'd have to run eclipse as root & I'd not be able to trace process though the source cause it's all be scattered thought the file system.

Problems came when I tried to install a new module. I couldn't get it into the module list & even zipping it up and trying to import it through the client failed without errors.

While trying to get the module I added to show up I discovered this on the forums "You'll have to run setup.py install after putting the module in addons if you didn't specify an addons path when running openerp-server."

So it looked like I had to run:

python setup.py build
sudo python setup.py install

Firstly I'm confused about why you need to build I thought it was onlt the c libs that needed building and I'd done that when installing dependences.

Secondly setup.py install is obviosuly vital if you need to run it to get a new module recognised. How can I trace stuff through the source if it's running from all over the file system.

Everything has now been copied out of home into the file system as I had tried to avoid. Now the start up scripts are in usr/local/bin so I assume I can't run, using 'debug as' in eclipse or see the logs in the eclipse console. I also found in the documentation that that suggests starting the server with:

./openerp-server.py –addons-path=~/home/workspace/stable/addons

Which apparently overrides the addons in the file system created by the install, suggesting that you'd have just the modules in addon in eclipse where one could debug etc, but the other resources would be elsewhere?

I suppose that's ok, but I still have trouble visualizing how this is going to work, I suppose if this is the way it's done then how would one get standard out to go to the eclipse console?

I suppose I could have the complete project in eclipse but all the resources besides the addons would just be for reference purposes, while only the addons would actually be running since they are over-ridden by the –addons-path argument.

Then if I could get output to go to the console it would be like what I would expect.

I've seen some references to using links in the eclipse workspace or running eclipse as root like an eclipse php setup.

Can anyone tell me how to start the server and web apps from eclipse and have the log output appear in the console?

Maybe an experienced python developer can spot my blind spots & suggests what I may be else I might be missing here?

2
If you just started learning Python and you come from Java background, this may be somehow helpful to you: Python is not Java, although this is not an answer to your "question".Tadeck
Ok it was a long winded narrative rather then a question. Thanks that was a good aritical it had some excellent tips & reminded me that I have to get my head around those class,object,instance differrences sooner rather then later. Maybe I should clear my mind and read foundational python again. But IDE workflows are not unique to java. I just want to settup my workspace correctly, do you have an advice there?justify
@Tadeck Actually the whole of dirtsimple.org is awaresome! Thanks for the ref.justify

2 Answers

3
votes

I feel your pain. I went through the same process a couple of years ago when I started working with OpenERP. The good news is that it's not too hard to set up, and OpenERP runs smoothly in Eclipse with PyDev.

Start by looking at the developer book for OpenERP. They lay out most of the requirements for getting it running.

To try and answer your specific questions, you shouldn't need to run the setup.py script at all in your development environment. It's only necessary when you deploy to a server. To get the server to recognize a new module, go to the administration menu, and choose Modules Management: Update Modules List. I'm still running OpenERP 5.0, so the names and locations might be slightly different in version 6.1.

For the project configuration in Eclipse, I just checked out each branch from launchpad, and then imported each one as a project into my Eclipse workspace. The launch details are a bit different between 6.0 and 6.1. Here are my command line arguments for each:

6.0:

--addons-path ${workspace_loc:openerp-addons-6.0} --config ${workspace_loc:openerp-config/src/server.config} --xmlrpc-port=9069 --netrpc-port=9070 --xmlrpcs-port=9071

6.1 needs the web client to launch with the server:

--addons-path ${workspace_loc:openerp-addons-trunk},${workspace_loc:openerp-web-trunk}/addons,${workspace_loc:openerp-migration} --config ${workspace_loc:openerp-config/src/server.config} --xmlrpc-port=9069 --netrpc-port=9070 --xmlrpcs-port=9071

-1
votes

using eclipse kepler sr 1, pydev 3.1.0, openerp 7.0 from launchpad using bzr, ubuntu 13.10. This is how I got the whole thing loaded. I have skipped the part where I got the thing to work. This only covers retrieving the sources and being able to open/modify the openerp source in eclipse/pydev.

There are three bzr repositories you need to get, the server, the web client addons and the bundled addons.

So I created a top level directory called openerp-bzr. In this directory, I checked out the sources with the following command. Note the use of checkout and --lightweight, these options prevent fetching of all the logs and history (making it much smaller and faster). You may want to omit the --lightweight if you want to get everything and change the checkout to branch if that is what you want to do. Back to business. You will have create an account on launchpad and register your ssh keys and configure your bzr.

bzr checkout --lightweight lp:openobject-server/7.0 openobject-server-7.0
bzr checkout --lightweight lp:openerp-web/7.0 openerp-web-7.0
bzr checkout --lightweight lp:openobject-addons/7.0 openobject-addons-7.0

(these folders that just got created, I will call them source folders).

(insert here the instructions to get this to work, which includes configuring the configuration file, setting the PYTHONPATH and downloading all the dependencies. I will add these in the weekend).

Then, still in the openerp-bzr folder, I create links. The first folder openerp-7.0 that is created, I will call it link folder.

ln -s openobject-server-7.0 openerp-7.0
cd openerp-7.0/openerp/addons
ln -s ../../../openobject-addons-7.0/* .
ln -s ../../../openerp-web-7.0/addons/* .

Now, if your eclipse is properly setup, you create a new pydev project, checking the create links to existing sources (select them on the next page), go next and addopenerp-7.0` (the link folder).

You can do bzr update in the source folders.

When you develop addons, create the actual folders somewhere else and then link them into the the addons folders in the link folder. This will make it look like you are working in the same tree, you will get all the references and code completion as well as (hopefully, because I have not tested this part!) debugging.