Преглед на файлове

[fix] link broken in quick entry and filter setting in list view

version-14
Rushabh Mehta преди 8 години
родител
ревизия
258ec9a5f9
променени са 4 файла, в които са добавени 19 реда и са изтрити 12 реда
  1. +2
    -6
      frappe/public/js/frappe/form/control.js
  2. +1
    -1
      frappe/public/js/frappe/form/quick_entry.js
  3. +5
    -1
      frappe/public/js/frappe/ui/base_list.js
  4. +11
    -4
      frappe/public/js/frappe/ui/filters/filters.js

+ 2
- 6
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(),


+ 1
- 1
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);


+ 5
- 1
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;


+ 11
- 4
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) {


Зареждане…
Отказ
Запис