fix: Remove dynamic link logic from make_new function

This commit is contained in:
deepeshgarg007 2019-05-29 14:36:10 +05:30
parent 35c0b6b2fc
commit abd822b943

View file

@ -509,12 +509,7 @@ _f.Frm.prototype.make_new = function(doctype) {
// set link fields (if found)
frappe.get_meta(doctype).fields.forEach(function(df) {
if(df.fieldtype==='Link' && df.options==="DocType") {
new_doc[df.fieldname] = me.doctype;
}
if((df.fieldtype==='Link' && df.options===me.doctype)
|| (df.fieldtype==='Dynamic Link' && new_doc[df.options] === me.doctype)) {
if(df.fieldtype==='Link' && df.options===me.doctype) {
new_doc[df.fieldname] = me.doc.name;
}
});