Merge pull request #7363 from rohitwaghchaure/terms_and_conditions_for_company
set default terms and condition if tc_name is available on the form
diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js
index dcbb56b..799730e 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -349,7 +349,7 @@
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);
}