Skip to content
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

[FW][FIX] core: fix recursion check #151799

Closed

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Jan 30, 2024

Prevent an infinite loop when the cycle in the parents does not contain the starting id: 3->2->1->2->1...

Example:

>>> m=self.env['ir.module.category']
>>> c1,c2,c3 = map(m.browse,[1,2,3])
>>> c2.parent_id = False
>>> c3.parent_id = False
>>> c1.parent_id = c2
>>> (c3|c2).parent_id = c1  # this never ends

With current patch the call to _check_recursion successfully detects the new cycle.

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Forward-Port-Of: #151549
Forward-Port-Of: #151294

Prevent an infinite loop when the cycle in the parents does not contain
the starting id: `3->2->1->2->1...`

Example:
```
>>> m=self.env['ir.module.category']
>>> c1,c2,c3 = map(m.browse,[1,2,3])
>>> c2.parent_id = False
>>> c3.parent_id = False
>>> c1.parent_id = c2
>>> (c3|c2).parent_id = c1  # this never ends
```

With current patch the call to `_check_recursion` successfully detects
the new cycle.

X-original-commit: e7c6445
@robodoo
Copy link
Contributor

robodoo commented Jan 30, 2024

@fw-bot
Copy link
Contributor Author

fw-bot commented Jan 30, 2024

This PR targets 13.0 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Jan 30, 2024
@fw-bot
Copy link
Contributor Author

fw-bot commented Jan 30, 2024

@aj-fuentes @rco-odoo ci/runbot failed on this forward-port PR

@C3POdoo C3POdoo added the RD research & development, internal work label Jan 30, 2024
@Xavier-Do
Copy link
Contributor

@robodoo r+

robodoo pushed a commit that referenced this pull request Jan 31, 2024
Prevent an infinite loop when the cycle in the parents does not contain
the starting id: `3->2->1->2->1...`

Example:
```
>>> m=self.env['ir.module.category']
>>> c1,c2,c3 = map(m.browse,[1,2,3])
>>> c2.parent_id = False
>>> c3.parent_id = False
>>> c1.parent_id = c2
>>> (c3|c2).parent_id = c1  # this never ends
```

With current patch the call to `_check_recursion` successfully detects
the new cycle.

closes #151799

X-original-commit: e7c6445
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
@robodoo robodoo closed this Jan 31, 2024
@fw-bot fw-bot deleted the 13.0-11.0-fix_recursion_check-afu-1gPe-fw branch February 14, 2024 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forwardport This PR was created by @fw-bot RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants