Comment 2 for bug 1267149

Revision history for this message
Gustavo Adrian Marino (gamarino) wrote : Re: [Bug 1267149] [NEW] [7.0][Trunk] Server will crash if import from missing addons is made

It is not the only problem.
If a module has a static javascript file, it will be loaded in UI even IF
THE MODULE IS NOT INSTALLED!, just because is in addons path.
There is no need to do that.
Regards

Gustavo Adrian Marino

Mobile: +54 911 5498 2515

Email: <email address hidden>

Skype: gustavo.adrian.marino

2014/1/8 Nicolas Bessi - Camptocamp <email address hidden>

> Public bug reported:
>
> 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 A addon.
> 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 state.
>
> 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
>
> ** Affects: openobject-server
> Importance: Undecided
> Status: New
>
> ** Description changed:
>
> 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
> + 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 A addon.
> + 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.
> + order to prepare final model state.
>
> - But I'm a little perplex on the reason of loading all files of an addon
> when graphing the addons dependence tree.
> + 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
>
> --
> You received this bug notification because you are subscribed to OpenERP
> Server.
> https://bugs.launchpad.net/bugs/1267149
>
> Title:
> [7.0][Trunk] Server will crash if import from missing addons is made
>
> Status in OpenERP Server:
> New
>
> Bug description:
> 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 A addon.
> 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 state.
>
> 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
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openobject-server/+bug/1267149/+subscriptions
>