From b3a6338c79f914846933f34f94bb50cc4a14efa0 Mon Sep 17 00:00:00 2001 From: tunde Date: Fri, 1 Sep 2017 11:35:22 +0100 Subject: [PATCH] patch replace credit_days with payment terms schedule --- .../patches/v8_10/change_default_customer_credit_days.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/erpnext/patches/v8_10/change_default_customer_credit_days.py b/erpnext/patches/v8_10/change_default_customer_credit_days.py index b016b66fa16..3b9f65da3b8 100644 --- a/erpnext/patches/v8_10/change_default_customer_credit_days.py +++ b/erpnext/patches/v8_10/change_default_customer_credit_days.py @@ -21,10 +21,11 @@ def execute(): value_query_str = " ".join(payment_terms) cond_query_str = " ELSE `payment_terms` END WHERE " - frappe.db.sql( - begin_query_str + value_query_str + cond_query_str + '`customer_name` IN %s', - (customers,) - ) + if customers: + frappe.db.sql( + begin_query_str + value_query_str + cond_query_str + '`customer_name` IN %s', + (customers,) + ) def make_template(payment_term):