Comment 5 for bug 799378

Revision history for this message
Vo Minh Thu (thu) wrote : Re: Error reading fields of an object inherited by prototyping

The (almost same) bug is reproducible in trunk.

The problem as described in the bug report is the following:

Base are CRM installed. CRM (specifically crm.lead) makes a copy of Base (specifically res.partner.address) _columns. Then a new module NEW is installed, which modifies Base (adding a new column in res.partner.address).

That new column is not present in database for the CRM (which is correct, because it used an unmodified Base). The problem is that the new column appears in CRM _columns. This happens because loading installed modules and installing modules is done in a single pass. And in this case CRM is loaded after the newly installed NEW module. Net effect: CRM _columns have one more column than its database column.

In trunk:

In trunk, the problem is partially solved: installed modules are loaded prior to any module to be installed. So CRM is loaded before NEW, and its _columns and database column are in sync. But there is still a problem: when restarting the server, the modules are loaded. If NEW is loaded before CRM (i.e. opposite order of the installation time), CRM will see a new column in Base. So its _columns have again a spurious column w.r.t. the database.

Workaround:

The proposed workaround before we fix this, is to add an excplicit order between modules: i.e. NEW should depends on the CRM to make sure the CRM is loaded before (and thus unaffected by) NEW.

Possible solution:

We have to discuss this more in detail at the R&D but we think to store the installation order of the installed modules so that we can later load them in the same order. Each module will see its parent modules exactly as they were at installation time (and thus keep their _columns in sync with the database).