Add a global method to set default warehouse
issue8396 review277371003
This commit is contained in:
+1
-3
@@ -333,9 +333,7 @@ class Purchase(Workflow, ModelSQL, ModelView, TaxableMixin):
|
||||
@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()
|
||||
|
||||
@staticmethod
|
||||
def default_company():
|
||||
|
||||
Reference in New Issue
Block a user