diff --git a/frappe/public/js/frappe/form/control.js b/frappe/public/js/frappe/form/control.js index 854f04369a..bd4e876165 100755 --- a/frappe/public/js/frappe/form/control.js +++ b/frappe/public/js/frappe/form/control.js @@ -1351,11 +1351,7 @@ frappe.ui.form.ControlLink = frappe.ui.form.ControlData.extend({ frappe._from_link_scrollY = $(document).scrollTop(); 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; @@ -1590,7 +1586,7 @@ frappe.ui.form.ControlLink = frappe.ui.form.ControlData.extend({ validate: function(value) { // validate the value just entered if(this.df.options=="[Select]" || this.df.ignore_link_validation) { - return; + return value; } return this.validate_link_and_fetch(this.df, this.get_options(), diff --git a/frappe/public/js/frappe/form/quick_entry.js b/frappe/public/js/frappe/form/quick_entry.js index 45cf759d7c..299f14176d 100644 --- a/frappe/public/js/frappe/form/quick_entry.js +++ b/frappe/public/js/frappe/form/quick_entry.js @@ -138,7 +138,7 @@ frappe.ui.form.QuickEntryForm = Class.extend({ frappe.model.clear_doc(me.dialog.doc.doctype, me.dialog.doc.name); me.dialog.doc = r.message; if(frappe._from_link) { - frappe.ui.form.update_calling_link(me.dialog.doc.name); + frappe.ui.form.update_calling_link(me.dialog.doc); } else { if(me.after_insert) { me.after_insert(me.dialig.doc); diff --git a/frappe/public/js/frappe/ui/base_list.js b/frappe/public/js/frappe/ui/base_list.js index 48373e4796..0d259edb4e 100644 --- a/frappe/public/js/frappe/ui/base_list.js +++ b/frappe/public/js/frappe/ui/base_list.js @@ -289,7 +289,11 @@ frappe.ui.BaseList = Class.extend({ frappe.route_options = null; }, - run: function (more) { + run: function(more) { + setTimeout(() => this._run(more), 100); + }, + + _run: function (more) { var me = this; if (!more) { this.start = 0; diff --git a/frappe/public/js/frappe/ui/filters/filters.js b/frappe/public/js/frappe/ui/filters/filters.js index e1f599f21f..55c07fc4ac 100644 --- a/frappe/public/js/frappe/ui/filters/filters.js +++ b/frappe/public/js/frappe/ui/filters/filters.js @@ -50,6 +50,11 @@ frappe.ui.FilterList = Class.extend({ clear_filters: function() { $.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 = []; }, @@ -224,7 +229,7 @@ frappe.ui.Filter = Class.extend({ // set the field if(me.fieldname) { // 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 { me.set_field(me.doctype, 'name'); } @@ -255,7 +260,7 @@ frappe.ui.Filter = Class.extend({ this.wrapper.find('.condition').val(condition).change(); } 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(); 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 $(me.field.wrapper).find(':input').keydown(function(ev) { @@ -329,6 +335,7 @@ frappe.ui.Filter = Class.extend({ df.original_type = df.fieldtype; df.description = ''; df.reqd = 0; + df.ignore_link_validation = true; // given if(fieldtype) {