From 8579dd1d78d75429e88707d2f1fb62f4c4884872 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Thu, 27 Jul 2017 11:21:54 +0530 Subject: [PATCH] [minor] If customer has removed getting an error (#10107) --- erpnext/accounts/doctype/tax_rule/tax_rule.js | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.js b/erpnext/accounts/doctype/tax_rule/tax_rule.js index 935ea62b67b..16041a850de 100644 --- a/erpnext/accounts/doctype/tax_rule/tax_rule.js +++ b/erpnext/accounts/doctype/tax_rule/tax_rule.js @@ -20,20 +20,22 @@ frappe.ui.form.on("Tax Rule", "refresh", function(frm) { }) frappe.ui.form.on("Tax Rule", "customer", function(frm) { - frappe.call({ - method:"erpnext.accounts.doctype.tax_rule.tax_rule.get_party_details", - args: { - "party": frm.doc.customer, - "party_type": "customer" - }, - callback: function(r) { - if(!r.exc) { - $.each(r.message, function(k, v) { - frm.set_value(k, v); - }); + if(frm.doc.customer) { + frappe.call({ + method:"erpnext.accounts.doctype.tax_rule.tax_rule.get_party_details", + args: { + "party": frm.doc.customer, + "party_type": "customer" + }, + callback: function(r) { + if(!r.exc) { + $.each(r.message, function(k, v) { + frm.set_value(k, v); + }); + } } - } - }); + }); + } }); frappe.ui.form.on("Tax Rule", "supplier", function(frm) {