On warehouse searcher, consider the case when location's warehouse is None.

(grafted from 54b6bda0aba6fd5e6a98318eb590114aaffbd2c2)
This commit is contained in:
Albert Cervera i Areny 2016-10-13 12:26:08 +02:00
parent f33f5e9440
commit 631eabc1a7
1 changed files with 2 additions and 1 deletions

View File

@ -81,6 +81,7 @@ class Location(ModelSQL, ModelView):
for location in cls.search([
('parent', 'child_of', storage_location_ids),
]):
if location.warehouse.id in found_warehouse_ids:
if (location.warehouse
and location.warehouse.id in found_warehouse_ids):
warehouse_location_ids.append(location.id)
return [('id', 'in', warehouse_location_ids)]