From 45ccdc90600330ae9b0fa5f591cd4a2fd2de4356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 30 May 2016 22:22:19 +0200 Subject: [PATCH] Search also for inactive warehouse in get_warehouse issue5580 review27301003 --- location.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/location.py b/location.py index cbfac486ba..75e86c72b6 100644 --- a/location.py +++ b/location.py @@ -207,10 +207,11 @@ class Location(ModelSQL, ModelView): def get_warehouse(self, name): # Order by descending left to get the first one in the tree - locations = self.search([ - ('parent', 'parent_of', [self.id]), - ('type', '=', 'warehouse'), - ], order=[('left', 'DESC')]) + with Transaction().set_context(active_test=False): + locations = self.search([ + ('parent', 'parent_of', [self.id]), + ('type', '=', 'warehouse'), + ], order=[('left', 'DESC')]) if locations: return locations[0].id