From 96bb6099d6ca1865b7c6f5888643df66be5d5dac Mon Sep 17 00:00:00 2001 From: _JG_ Date: Tue, 18 Jul 2017 23:57:09 -0500 Subject: [PATCH] [fix] correctly choice 'Credit Limit' (#9932) * [fix] correctly choice 'credit limit' If 'Credit Days Based On' is empty in 'Supplier Type/Customer Group' then value 'Due Date' in 'Purchase/Sales Invoice' doesn't taken from the default settings * Update party.py * [fix] correctly choice 'Credit Limit' --- erpnext/accounts/party.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index bf509de84fe..b88623b3adc 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -284,12 +284,14 @@ def get_credit_days(party_type, party, company): if not credit_days_based_on: if party_type == "Customer": credit_days_based_on, credit_days = \ - frappe.db.get_value("Customer Group", customer_group, ["credit_days_based_on", "credit_days"]) \ - or frappe.db.get_value("Company", company, ["credit_days_based_on", "credit_days"]) + frappe.db.get_value("Customer Group", customer_group, ["credit_days_based_on", "credit_days"]) else: credit_days_based_on, credit_days = \ - frappe.db.get_value("Supplier Type", supplier_type, ["credit_days_based_on", "credit_days"])\ - or frappe.db.get_value("Company", company, ["credit_days_based_on", "credit_days"] ) + frappe.db.get_value("Supplier Type", supplier_type, ["credit_days_based_on", "credit_days"]) + + if not (credit_days_based_on and credit_days): + credit_days_based_on, credit_days = \ + frappe.db.get_value("Company", company, ["credit_days_based_on", "credit_days"]) return credit_days_based_on, credit_days