[minor] [fix] when making control, use form's perm

This commit is contained in:
Anand Doshi 2013-10-02 17:27:08 +05:30
parent 1dc6d08cef
commit 12431c96e6

View file

@ -43,7 +43,7 @@ wn.ui.form.Control = Class.extend({
if(!this.doctype)
return "Write";
return wn.perm.get_field_display_status(this.df,
locals[this.doctype][this.docname], this.perm, explain);
locals[this.doctype][this.docname], this.perm || this.frm.perm, explain);
},
refresh: function() {
this.disp_status = this.get_status();
@ -794,7 +794,7 @@ wn.ui.form.ControlTable = wn.ui.form.Control.extend({
this.grid = new wn.ui.form.Grid({
frm: this.frm,
df: this.df,
perm: this.perm,
perm: this.perm || this.frm.perm,
parent: this.wrapper
})
if(this.frm)