Read Only field fix and cache fix
This commit is contained in:
parent
af8496915e
commit
c6f95b5bb7
3 changed files with 12 additions and 13 deletions
|
|
@ -119,17 +119,6 @@ wn.ui.form.ControlImage = wn.ui.form.Control.extend({
|
|||
}
|
||||
});
|
||||
|
||||
wn.ui.form.ControlReadOnly = wn.ui.form.Control.extend({
|
||||
make: function() {
|
||||
this._super();
|
||||
var me = this;
|
||||
this.$wrapper.on("refresh", function() {
|
||||
var value = wn.model.get_value(me.doctype, me.docname, me.fieldname);
|
||||
me.$wrapper.html(value);
|
||||
})
|
||||
},
|
||||
});
|
||||
|
||||
wn.ui.form.ControlInput = wn.ui.form.Control.extend({
|
||||
horizontal: true,
|
||||
make: function() {
|
||||
|
|
@ -333,6 +322,16 @@ wn.ui.form.ControlData = wn.ui.form.ControlInput.extend({
|
|||
}
|
||||
});
|
||||
|
||||
wn.ui.form.ControlReadOnly = wn.ui.form.ControlData.extend({
|
||||
get_status: function(explain) {
|
||||
var status = this._super(explain);
|
||||
if(status==="Write")
|
||||
status = "Read";
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
wn.ui.form.ControlPassword = wn.ui.form.ControlData.extend({
|
||||
input_type: "password"
|
||||
});
|
||||
|
|
|
|||
|
|
@ -206,7 +206,6 @@ $.extend(wn.model, {
|
|||
raise "CustomerAgeError";
|
||||
}
|
||||
}) */
|
||||
console.log([doctype, fieldname])
|
||||
wn.provide("wn.model.events." + doctype);
|
||||
if(!wn.model.events[doctype][fieldname]) {
|
||||
wn.model.events[doctype][fieldname] = [];
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ def clear(user=None):
|
|||
|
||||
def clear_cache(user=None):
|
||||
cache = webnotes.cache()
|
||||
|
||||
webnotes.model.doctype.clear_cache()
|
||||
|
||||
if user:
|
||||
cache.delete_value("bootinfo:" + user)
|
||||
|
|
@ -43,7 +45,6 @@ def clear_cache(user=None):
|
|||
webnotes.defaults.clear_cache(user)
|
||||
else:
|
||||
cache.delete_value(["app_hooks", "installed_apps", "app_modules", "module_apps"])
|
||||
webnotes.model.doctype.clear_cache()
|
||||
|
||||
for sess in webnotes.conn.sql("""select user, sid from tabSessions""", as_dict=1):
|
||||
cache.delete_value("lang:" + sess.user)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue