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

[15.0] Forward-port of [FIX] sale_order_line_chained_move: Fix infinite recursion #3586

Open
wants to merge 1 commit into
base: 15.0
Choose a base branch
from

Conversation

marielejeune
Copy link
Contributor

Forward-port of the original fix in v13. See PRs #2638 (v13) and #2650 (v14).

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
@OCA-git-bot
Copy link
Contributor

Hi @rousseldenis,
some modules you are maintaining are being modified, check this out!

@marielejeune marielejeune changed the title [15.0[FIX] sale_order_line_chained_move: Fix infinite recursion [15.0][FIX] sale_order_line_chained_move: Fix infinite recursion Feb 20, 2025
@marielejeune marielejeune changed the title [15.0][FIX] sale_order_line_chained_move: Fix infinite recursion [15.0] Forward-port of [FIX] sale_order_line_chained_move: Fix infinite recursion Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants