From 585448b225f495a4dd139674f11c47bbc109e225 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 30 Dec 2016 15:41:55 +0530 Subject: [PATCH] set default terms and condition if tc_name is available on the form --- erpnext/public/js/controllers/transaction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index dcbb56b857..799730edd5 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -349,7 +349,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ me.frm.set_value("letter_head", company_doc.default_letter_head); } } - if (company_doc.default_terms && me.frm.doc.doctype != "Purchase Invoice") { + if (company_doc.default_terms && me.frm.doc.doctype != "Purchase Invoice" && frappe.meta.has_field(me.frm.doc.doctype, "tc_name")) { me.frm.set_value("tc_name", company_doc.default_terms); }