Comment 8 for bug 996816

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

I agree with Quentin, this is an annoying issue affecting the flexibility and consistency of OpenERP when inheriting by prototype (using _inherit with a different _name).
As we've seen there are many bugs that come from this: all those bugs with missing columns and SQL errors that depend on the order of module installation.

We want OpenERP module installation to work regardless of the order in which unrelated modules are installed, and due to this issue we do not have the guarantee that it will work at the moment.

Amit, we have fixed some of the current bug reports on addons side, but in every case it was a dirty hack, usually by copying the column from the parent, or introducing "fake" dependencies. This is not good at all, and proves we need to find a solution at the framework level.

One possible technical solution would be for the system to refresh all "cousin" (different _name) models when a new _inheriting model is loaded, but I think that requires quite a lot of low-level hacking in the module loading code. In order to refresh/reload a given "cousin" model we'd have to go though its inheritance tree, and refresh all ancestors, possibly requiring the original Python class to be available in the process. And this would have to be done during module install/upgrade as well, in order to properly update the database schema.
So I'm not quite sure of the technical solution to adopt, but we definitely need to solve this.