-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[13.0][FIX] sale_order_line_chained_move: Fix infinite recursion #2638
base: 13.0
Are you sure you want to change the base?
[13.0][FIX] sale_order_line_chained_move: Fix infinite recursion #2638
Conversation
Hi @rousseldenis, |
This would be applicable to newer Odoo versions too (>=13). Tried to find the oldest commit that had the bug and based my fix on top of that commit, but it seems that there's something strange happening since 13.0, 14.0, 15.0 and 16.0 branches don't seem to share history and therefore it's not possible to merge this to the newer branches. Maybe you have some kind of cherry-pick based forward/backward porting procedure? (I'm used to forward porting with merges, since I find it easiest way to keep track which fixes are included to which branch) |
Hello @suutari-ai reproduced this error in v14. If you want to propagate the fix to other versions, you should make cherry-pick, please check (e.g. for v14):
Then, in new branch you've ported commit fix to required version |
Sure I can cherry-pick it to 14, 15 and 16 too, but how does the process go from there? Should I create a PR for each version? |
Sure. Then, each PR should have a reference to original PR e.g. like #2398 |
It seems that this module doesn't exists in 15.0 or 16.0 anymore. Ported the fix to 14.0 in GitHub PR #2650. Anything else you need from me to get this fix merged to 13.0 and 14.0? |
I notice two cosmetic changes to be done:
And Codecov is not passed, tests should be improved, and probably cover that situation you've fixed. But I'm not sure, maybe this PR could be merged without passing Codecov. |
0b95c16
to
9c39ef4
Compare
Done
Shortened it a bit, but I think parts of the traceback are useful since they help people find these discussions and commits when they hit the same problem.
If you don't want to accept my contribution, because your test suite is not good enough that's up to you. I'm not familiar with your test suite and probably don't have time to create tests for this case. |
The `__find_origin_moves` function doesn't take into account loops in the chains of origin moves. Fix this by adding a "visited" record set which will make sure that any move that has already be expanded won't be processed again. This will allow updating the modules (`odoo-bin -u all`) even when there is existing data which has cycles in their origin graph. The error for that case looked like this: INFO odoo odoo.modules.loading: Loading module sale_order_line_chained_move (185/225) ... File ".../thirdparty/odoo/addons/sale_order_line_chained_move/hooks.py", line 10, in __find_origin_moves all_moves |= __find_origin_moves(move.move_orig_ids) [Previous line repeated 978 more times] File ".../thirdparty/odoo/addons/sale_order_line_chained_move/hooks.py", line 9, in __find_origin_moves if move.move_orig_ids: ... RecursionError: maximum recursion depth exceeded
9c39ef4
to
bfbdff8
Compare
Not my test suite, but OCA's (in Github actions results for this PR): https://github.com/OCA/sale-workflow/pull/2638/files#annotation_13622753039 I'm trying to do my best helping you to pass everything, so this PR could be merged, because your fix seems to be good and I'm actually interested in it 😅. But my approval shouldn't be enough if the user that can merge it (not me) requires Covecod to be passed. @rousseldenis should this PR be merged even if Codecov is red or is mandatory passing it? |
The
__find_origin_moves
function doesn't take into account loops in the chains of origin moves. Fix this by adding a "visited" record set which will make sure that any move that has already be expanded won't be processed again.This will allow updating the modules (
odoo-bin -u all
) even when there is existing data which has cycles in their origin graph. The error for that case looked like this: