Base module upgrade do not delete old records (unreferenced IDS)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Fix Released
|
Medium
|
OpenERP's Framework R&D |
Bug Description
When updating several modules (launching the server with -u all), at the end of the process it removes old records (records that have an XML ID but those XML ID are not referenced by the data/demo files of the module). It's working efficiently for all the modules but not for the 'base' module. This makes the migration of the base module very difficult.
Technically speaking:
* The problem is in addons/__init__.py
* The module base is installed before others with skip_cleanup=True
* then all others modules are installed with skip_cleanup=False
* skip cleanup calls _process_end on the obejct ir.model.data, which uses self.loads that includes all IDS parsed from data files and compare this with IDS in ir.model.data for the selected module.
You can not set skip_cleanup=False for base. (because some modules references records with base.group_
How to replicate:
- remove a record in a XML file of the data of the base module (like the Customers menu)
- update all modules
- check that the menu disappeared (currently it does not disappears)
- reput the record in the XML file
- update all modules
- check that the menu appears again
Related branches
description: | updated |
Fixed in revision 3224 <email address hidden> by deferring module cleanup at the end of installation process, and also avoiding to load twice the same module, which could interfere with the process (by reloading ir.model.data) and is needless.