Comment 0 for bug 1267149

Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Hello,

Let say I have module A and module B.

B depends on A in __openerp__.py but the two addons are in different branches.

In B addons I have this code somewhere in the code:

from openerp.addons.A.a_module import myhelper

If I have B in addons path but not A server will raise an import error even if I have not require the istallation of the addons.
This will lead to a server crash at startup with a unclear error message

This will also force people to have more branch to retrieve with all the trouble that goes along.

I understand why all the files with model classes have to be loaded in order to prepare final Model form.

But I'm a little perplex on the reason of loading all files of an addon when graphing the addons dependence tree.
Only __openerp__.py should be loaded first in a safe manner, and when the graph is calculated then effectively load the packages.

It will avoid such trouble and also avoid (malicious) code to be executed when you do not want to.

Regards

Nicolas