set default terms and condition if tc_name is available on the form

This commit is contained in:
Rohit Waghchaure 2016-12-30 15:41:55 +05:30
parent ae25e0da88
commit 585448b225

View File

@ -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);
}