Incorrect organisation of the code

Bug #520006 reported by Mathieu Leduc-Hamel
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Status tracked in Trunk
Trunk
Fix Released
Wishlist
OpenERP's Framework R&D

Bug Description

I was trying to create a zc.buildout style project of deployement of OpenERP. I created a customer python egg project which will act as a kind of patch to customized our OpenERP installation.

By doing that I discovered that all the code of OpenObject lib is located in the bin/ dir and cannot be used as an external library. It's a very stange organisation of the code.

By example, of you take a look at the openobject-client-web project, there's is a directory at the top named "openobject" containing all the code. I can refer to this namespace in other project. But for the server it's very impossible do doing that.

Maybe converting OpenObject as good python citizen would be a important. no ? And if not, how can I import a module of OpenObject in a project ?

I proposed the following architecture:

openobject.server/
    setup.py
    ...
    openobject/
         __init__.py
         server/
             addons/
             ir/
             osv/
             pychart/
             report/
             service/
             ssl/
             tools/
             wizard/
             workflow/
             ...

Tags: long-term

Related branches

Changed in openobject-server:
assignee: nobody → Stephane (Open ERP) (stephane-openerp)
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

As noted by Christophe, Stéphane already has a project going to fix this issue in the future.

Changed in openobject-server:
status: New → Confirmed
importance: Undecided → Wishlist
Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) wrote :

I'm pushing my branch, but this one is not finished.

Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote : Re: [Bug 520006] Re: Incorrect organisation of the code

On 11 Feb 2010, at 09:54 , Stephane (Open ERP) wrote:
>
> I'm pushing my branch, but this one is not finished.

Its status being development or experimental would make that clear (I think it's development currently, I'd suggest switching to experimental)

Revision history for this message
Numérigraphe (numerigraphe) wrote :

I agree that making OpenObject more pythonic is certainly a good in itself.
Now please excuse my ignorance, but would you care to explain how using the server as a library is useful? It's a framework after all - "don't call me, I'll call you" they say.
Is it to ease debugging? or to integrate OpenObject in a bigger framework?
Lionel

Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) wrote :

-----BEGIN PGP M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ySk/cFJGDgOKecFK7D6UI0mXuTnkfjo1KlsHZEZWCWK
9IbbxnhCElMAivio1cxnEyYXI8ktx3Xlzb2MBCRl9s9K0OV/VOMCjtb+XISMopxV
1jWq/VSyXilGUp3kyycl34AnTWAEICbre36Qw+kQPw2HK/m+DI3yLZPylXTVt5yY
Q3wDdmItmk3qfyylDQAg23I70vLUxMesfheYkJfo5qNb37oqhNv1scjEKKKqE443
V0hsIeTgKQs/x00oNxz24hq99Hd7Err4knVf4X95sFY/ccPbwYCt63xJRD2FEKjF
kLNOrupe8MrJW5ilMuMShG/iAMi3TFnPbd5nBQDkFkg1kzsmlD1/chamgMnAP0Zy
vh1YuHHil3Zpg/3POP+WnyDNzLGTFchcNScxfMeqgy6wlSDj
=JZTi
-----END PGP MESSAGE-----

Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) wrote :

Currently, I have splitted the server from OpenObject.

In the new bin directory of my branch, you will find two examples.

1. bin/openerp-server
This script uses the server component of OpenObject

2. bin/fetch_user
This script is just an example, it shows how to use the library without to start the server.

But this branch is in development, I will provide each week a new revision with a merge of the current trunk and the improvements of my refactoring.

Stephane

Revision history for this message
Mathieu Leduc-Hamel (marrakis) wrote :

Hello All,

@Numérigraphe:

Yes using openobject just as lib doesn't seems to be the way to use it
at first time but it's not exactly. The point is to be able to deploy
and maintain an installation using "normal" python tools like
virtualenv, zc.buildout, pip, supervisor, paster...

1. I'm from the Zope and Pylons world and for me it's very unlikely to
came the day I'll deploy a service with apt-get or something like
that.

2. The other point is to have a project correctly splited in modules,
modularisation is the way to go if we want to attract new developpers
and to ensure to have something rock solide.

@Stephane (Open ERP):

Very great work ! I was starting to move the code of openobject
exactly the same way as you did, yesterday. Was is the status of your
work ? Is there some bug related to the new organisation ? Is there
something I can do to help ?

Oh and by the way, the encrypted message was for me or it was a
mistake, cause I don't find a key to decrypt it...

On Thu, Feb 11, 2010 at 5:55 AM, Stephane (Open ERP) <email address hidden> wrote:
> Currently, I have splitted the server from OpenObject.
>
> In the new bin directory of my branch,  you will find two examples.
>
> 1. bin/openerp-server
> This script uses the server component of OpenObject
>
> 2. bin/fetch_user
> This script is just an example, it shows how to use the library without to start the server.
>
> But this branch is in development, I will provide each week a new
> revision with a merge of the current trunk and the improvements of my
> refactoring.
>
> Stephane
>
> --
> Incorrect organisation of the code
> https://bugs.launchpad.net/bugs/520006
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Mathieu,

I am glad to see that my code can be interesting for the community ;-)

Here is the steps.

Done:
1. I splitted the commnand line management from the config management.
2. I splitted the Logger from the NetSVC.

Present:
3. We can execute the server, and it seems to work fine.

Future:
4. With this refactoring, we can clean the setup.py because it's not very pythonist :/
5. Remove the Logger() method and the logger python file, because it's a duplicata of the logging python module
6. Clean the addons if my code is accepted in the trunk branch.
9. The addons/__init__.py file will disappear

In fact, with this refactoring, I want to improve the packaging of OpenERP

- --
Stephane Wirtel - "As OpenERP is OpenSource, please feel free to contribute."
Technical Project Manager
Tiny SPRL
40, Chaussee de Namur
B-1367 Gerompont
* Tel: +32.81.81.37.00
* Web: http://www.openerp.com
* Planet: http://www.openerp.com/planet/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkt0Hs4ACgkQnqh8s27uQNVXXACfS6la7aZYqbikRIsIn/cE0z/I
GJwAoMF/y4JM6hNupB5t+CGgdskqHHbp
=/ugt
-----END PGP SIGNATURE-----

tags: added: long-term
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

The OpenERP server has been recently reorganized in trunk to be a normal python module, similarly to what has been discussed here. As a result, it is now possible to "import openerp".

You can upgrade to the latest trunk version to test it (after revision 3354). You can also see this thread for more info: https://lists.launchpad.net/openerp-expert-framework/threads.html#00503

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.