From d7a5b7309b9d3363856c691c04087cda41e972fd Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 1 Apr 2015 23:38:13 +0530 Subject: [PATCH] [minor] fix --- erpnext/accounts/party.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index 8b4e6cbdcf..7ea0c66e74 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -14,6 +14,9 @@ from erpnext.utilities.doctype.contact.contact import get_contact_details def get_party_details(party=None, account=None, party_type="Customer", company=None, posting_date=None, price_list=None, currency=None, doctype=None): + if not party: + return {} + return _get_party_details(party, account, party_type, company, posting_date, price_list, currency, doctype) @@ -161,6 +164,9 @@ def get_due_date(posting_date, party_type, party, company): return due_date def get_credit_days(party_type, party, company): + if not party: + return None + party_group_doctype = "Customer Group" if party_type=="Customer" else "Supplier Type" credit_days, party_group = frappe.db.get_value(party_type, party, ["credit_days", frappe.scrub(party_group_doctype)])