Base module upgrade do not delete old records (unreferenced IDS)

Bug #699732 reported by Fabien (Open ERP)
6
This bug affects 1 person
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_hr_manager). We can not cleanup base moduel alone. So, the _process_end must be called only once, for all the modules at the end of the whole process. (with all modules, including base)

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
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

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.

Changed in openobject-server:
status: Confirmed → In Progress
milestone: none → 6.0
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.