← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 699732] Re: Base module upgrade do not delete old records (unreferenced IDS)

 

** Changed in: openobject-server
       Status: Confirmed => In Progress

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/699732

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

Status in OpenObject Server:
  Fix Released

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





References