From 25906f28ff60012d9794202c32bf8600a16659fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 8 Jan 2021 22:57:47 +0100 Subject: [PATCH] Prevent ValueError when from location is a view If the from location is a view, it may not be in the childs list. issue9896 review316751002 --- move.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/move.py b/move.py index ad18fbcb93..20a77e8e00 100644 --- a/move.py +++ b/move.py @@ -969,8 +969,12 @@ class Move(Workflow, ModelSQL, ModelView): except ValueError: pass # Try first to pick from source location - childs.remove(move.from_location) - childs.insert(0, move.from_location) + try: + childs.remove(move.from_location) + childs.insert(0, move.from_location) + except ValueError: + # from_location may be a view + pass index = {l.id: i for i, l in enumerate(childs)} location_qties = [] pbl_items = pbl.items()