Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
450 views
in Technique[技术] by (71.8m points)

eclipse - Python & OpenERP development environment setup howto?

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...