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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions sale_order_line_chained_move/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
from odoo import SUPERUSER_ID, api


def __find_origin_moves(moves):
def __find_origin_moves(moves, visited=None):
all_moves = moves
for move in moves:
unvisited_moves = (moves - visited) if visited else moves
for move in unvisited_moves:
visited = visited + move if visited else move
if move.move_orig_ids:
all_moves |= __find_origin_moves(move.move_orig_ids)
all_moves |= __find_origin_moves(move.move_orig_ids, visited)

Check warning on line 12 in sale_order_line_chained_move/hooks.py

View check run for this annotation

Codecov / codecov/patch

sale_order_line_chained_move/hooks.py#L12

Added line #L12 was not covered by tests
return all_moves


Expand Down