Search also for inactive warehouse in get_warehouse
issue5580 review27301003
This commit is contained in:
+5
-4
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user