From 3fd534f707bac7b12934cd6878c76e4e7d838260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 8 Aug 2017 17:18:38 +0200 Subject: [PATCH] Test purchase_drop_location value before returning id The default_drop_location method should not fail if there is no purchase_drop_location configured. issue6690 --- purchase.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/purchase.py b/purchase.py index 1473ce758c..d777bbc2be 100644 --- a/purchase.py +++ b/purchase.py @@ -123,7 +123,8 @@ class Purchase: PurchaseConfig = pool.get('purchase.configuration') config = PurchaseConfig(1) - return config.purchase_drop_location.id + if config.purchase_drop_location: + return config.purchase_drop_location.id @fields.depends('customer', 'delivery_address') def on_change_customer(self):