@@ -1351,11 +1351,7 @@ frappe.ui.form.ControlLink = frappe.ui.form.ControlData.extend({ | |||||
frappe._from_link_scrollY = $(document).scrollTop(); | frappe._from_link_scrollY = $(document).scrollTop(); | ||||
frappe.ui.form.make_quick_entry(doctype, (doc) => { | frappe.ui.form.make_quick_entry(doctype, (doc) => { | ||||
if(me.frm) { | |||||
me.parse_validate_and_set_in_model(doc.name); | |||||
} else { | |||||
me.set_value(doc.name); | |||||
} | |||||
return me.set_value(doc.name); | |||||
}); | }); | ||||
return false; | return false; | ||||
@@ -1590,7 +1586,7 @@ frappe.ui.form.ControlLink = frappe.ui.form.ControlData.extend({ | |||||
validate: function(value) { | validate: function(value) { | ||||
// validate the value just entered | // validate the value just entered | ||||
if(this.df.options=="[Select]" || this.df.ignore_link_validation) { | if(this.df.options=="[Select]" || this.df.ignore_link_validation) { | ||||
return; | |||||
return value; | |||||
} | } | ||||
return this.validate_link_and_fetch(this.df, this.get_options(), | return this.validate_link_and_fetch(this.df, this.get_options(), | ||||
@@ -138,7 +138,7 @@ frappe.ui.form.QuickEntryForm = Class.extend({ | |||||
frappe.model.clear_doc(me.dialog.doc.doctype, me.dialog.doc.name); | frappe.model.clear_doc(me.dialog.doc.doctype, me.dialog.doc.name); | ||||
me.dialog.doc = r.message; | me.dialog.doc = r.message; | ||||
if(frappe._from_link) { | if(frappe._from_link) { | ||||
frappe.ui.form.update_calling_link(me.dialog.doc.name); | |||||
frappe.ui.form.update_calling_link(me.dialog.doc); | |||||
} else { | } else { | ||||
if(me.after_insert) { | if(me.after_insert) { | ||||
me.after_insert(me.dialig.doc); | me.after_insert(me.dialig.doc); | ||||
@@ -289,7 +289,11 @@ frappe.ui.BaseList = Class.extend({ | |||||
frappe.route_options = null; | frappe.route_options = null; | ||||
}, | }, | ||||
run: function (more) { | |||||
run: function(more) { | |||||
setTimeout(() => this._run(more), 100); | |||||
}, | |||||
_run: function (more) { | |||||
var me = this; | var me = this; | ||||
if (!more) { | if (!more) { | ||||
this.start = 0; | this.start = 0; | ||||
@@ -50,6 +50,11 @@ frappe.ui.FilterList = Class.extend({ | |||||
clear_filters: function() { | clear_filters: function() { | ||||
$.each(this.filters, function(i, f) { f.remove(true); }); | $.each(this.filters, function(i, f) { f.remove(true); }); | ||||
if(this.base_list.page.fields_dict) { | |||||
$.each(this.base_list.page.fields_dict, (key, value) => { | |||||
value.set_input(''); | |||||
}); | |||||
} | |||||
this.filters = []; | this.filters = []; | ||||
}, | }, | ||||
@@ -224,7 +229,7 @@ frappe.ui.Filter = Class.extend({ | |||||
// set the field | // set the field | ||||
if(me.fieldname) { | if(me.fieldname) { | ||||
// pre-sets given (could be via tags!) | // pre-sets given (could be via tags!) | ||||
this.set_values(me._doctype, me.fieldname, me.condition, me.value); | |||||
return this.set_values(me._doctype, me.fieldname, me.condition, me.value); | |||||
} else { | } else { | ||||
me.set_field(me.doctype, 'name'); | me.set_field(me.doctype, 'name'); | ||||
} | } | ||||
@@ -255,7 +260,7 @@ frappe.ui.Filter = Class.extend({ | |||||
this.wrapper.find('.condition').val(condition).change(); | this.wrapper.find('.condition').val(condition).change(); | ||||
} | } | ||||
if(value!=null) { | if(value!=null) { | ||||
this.field.set_value(value); | |||||
return this.field.set_value(value); | |||||
} | } | ||||
}, | }, | ||||
@@ -310,8 +315,9 @@ frappe.ui.Filter = Class.extend({ | |||||
f.refresh(); | f.refresh(); | ||||
me.field = f; | me.field = f; | ||||
if(old_text && me.field.df.fieldtype===cur.fieldtype) | |||||
me.field.set_input(old_text); | |||||
if(old_text && me.field.df.fieldtype===cur.fieldtype) { | |||||
me.field.set_value(old_text); | |||||
} | |||||
// run on enter | // run on enter | ||||
$(me.field.wrapper).find(':input').keydown(function(ev) { | $(me.field.wrapper).find(':input').keydown(function(ev) { | ||||
@@ -329,6 +335,7 @@ frappe.ui.Filter = Class.extend({ | |||||
df.original_type = df.fieldtype; | df.original_type = df.fieldtype; | ||||
df.description = ''; df.reqd = 0; | df.description = ''; df.reqd = 0; | ||||
df.ignore_link_validation = true; | |||||
// given | // given | ||||
if(fieldtype) { | if(fieldtype) { | ||||