Comment 5 for bug 493657

Revision history for this message
Raphaƫl Valyi - http://www.akretion.com (rvalyi) wrote : Re: Custom fields obstructing updates

Hello again,

so I agree with Xavier's analysis: currently, as soon as a module loads an object, it loads all its custom fields. So custom fields referencing an object loaded by a module that is not yet loaded (because not a dependence of the current module; can perfectly happen, see the delivery module example) will never get a chance do the DDL it attempts in the _auto_init method.

I don't see any clean way of doing it. As Xavier says, those fields should be loaded at the end eventually or, as a less optimal solution is to forget any DDL in _auto_init when encountering a field that depends on a model that can be found using self.pool.get(model_name).

Meanwhile, if you are stuck with this bug, I wrote an SQL workaround to manage your server upgrade manually here:
https://bugs.launchpad.net/magentoerpconnect/+bug/484843

Hope to see a clean solution still. Due to the complexity of the bug resolution, I'm descoping it from 5.0.7. That's still an important bug. With it, 50% of custom fields which is pimped as a super OpenERP feature will never pass any server update for the mere mortal users.