Add a global method to set default warehouse

issue8396
review277371003
This commit is contained in:
Thierry Bruyere
2019-09-07 23:13:33 +02:00
parent afbaf7f16e
commit a2dad3e01b
+1 -3
View File
@@ -76,9 +76,7 @@ class WorkCenter(DeactivableMixin, tree(separator=' / '), ModelSQL, ModelView):
@classmethod
def default_warehouse(cls):
Location = Pool().get('stock.location')
locations = Location.search(cls.warehouse.domain)
if len(locations) == 1:
return locations[0].id
return Location.get_default_warehouse()
@classmethod
def get_picker(cls):