odoo/odoo#155709
Created by Paul Morelle (pmo)
- label
- odoo-dev:14.0-avoid_module_categ_loop-pmo
- head
- d28fb7a5a02cc8ac141d2a741c3b0f0a247a7b2f
- target
- 14.0
- merged
- 1 month ago by Upgrade, Christophe Simonis (chs)
- forward-ports
- odoo/odoo#161635 targeting master
- odoo/odoo#161606 targeting saas-17.2
- odoo/odoo#161594 targeting saas-17.1
- odoo/odoo#161583 targeting 17.0
- odoo/odoo#161562 targeting saas-16.4
- odoo/odoo#161547 targeting saas-16.3
- odoo/odoo#161523 targeting 16.0
- odoo/odoo#161497 targeting 15.0
[IMP] base: avoid infinite loops in _update_category
When updating the categories, if by any chance there is a loop in the category hierarchy, the current code was falling into an infinite loop.
With this commit, the graph loop is broken by clearing a parent_id, and if the resulting module category path is wrong, a clean new one will be recreated anyway.
This allows unblocking uncomfortable situations where people cannot update the modules list any more. In 15.0, [a check](https://github.com/odoo/odoo/commit/6932714200d158a21bf10b90b2f71fa5cae0b13f) has been introduced to prevent the existence of recursive categories, but as it is a python check it doesn't prevent corrupted data to remain corrupted.
[OPW-3704007](https://www.odoo.com/web#id=3704007&model=project.task)
Related to odoo/upgrade#5574