changeset 3f2bc4045889 in modules/purchase:default
details: https://hg.tryton.org/modules/purchase?cmd=changeset;node=3f2bc4045889
description:
Add a global method to set default warehouse
issue8396
review277371003
diffstat:
purchase.py | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diffs (14 lines):
diff -r d2b6ee33a0f8 -r 3f2bc4045889 purchase.py
--- a/purchase.py Wed Aug 21 22:51:36 2019 +0200
+++ b/purchase.py Sat Sep 07 23:13:33 2019 +0200
@@ -333,9 +333,7 @@
@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():