OpenUpgrade icon indicating copy to clipboard operation
OpenUpgrade copied to clipboard

[Question]Delete unistalled module during the pre-migration ?

Open flotho opened this issue 1 year ago • 4 comments

Is your feature request related to a problem?

During an update from 14 to 15 I faced a duplicate module name issue on module that are not installed.

Describe the solution you'd like I'm wondering if it could be a great idea to delete all modules that are not installed before executing the apriori.py operations

flotho avatar Nov 22 '24 23:11 flotho

We don't do it because there can be some module that need to be detected or to be marked as "to install", so this may prevent these operations.

pedrobaeza avatar Nov 23 '24 09:11 pedrobaeza

@flotho could you elaborate ? The modules conflicting ? Etc. Thanks !

legalsylvain avatar Nov 23 '24 13:11 legalsylvain

First, thanks a lot for reacting and explaining. Totally undestood what i missed @pedrobaeza . @legalsylvain I proposed this because of this one https://github.com/OCA/OpenUpgrade/pull/3556 This PR don't solve the issue I've faced. I have both l10n_eu_oss and l10n_eu_service present in my database and if failed because of a duplicate. As both module were not installed, I deleted all the uninstalled modules and then it wok like a charm. Maybe we could combine 2 behaviours :

  • First delete all unistalled modules
  • Then rescan all the available modules for the current version
  • let the process run smoothly

You're feedback will be welcome

flotho avatar Nov 23 '24 16:11 flotho

Yes, some code like:

modules = env['ir.module.module'].search([('state', '=', 'uninstalled')])
modules.unlink()
env['ir.module.module'].update_list()

may do the trick.

pedrobaeza avatar May 11 '25 09:05 pedrobaeza