New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IMP] base: avoid infinite loops in _update_category #155709
Conversation
Hello @madprog IMHO, if you have broken data, you should fix that data instead of adding code in order to take in account for broken data (and the warning won't be seen by the user). But if it's really necessary (if there are already a lot of databases with this problem), please don't forward it to the master. |
@ryv-odoo we are still getting this issue in upgrades, and there is no simple way to fix it unless standard code is resilient to this case. Happening at least in 16.3 also. |
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][1] 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 Related to odoo/upgrade#5574 [1]: odoo/odoo@6932714
b0c6897
to
d28fb7a
Compare
@robodoo r+ |
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][1] 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 Related to odoo/upgrade#5574 [1]: 6932714 closes #155709 Signed-off-by: Christophe Simonis (chs) <chs@odoo.com>
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 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
Related to odoo/upgrade#5574