[fix] [minor] on form layout refresh, use permissions of current form
This commit is contained in:
parent
5ef045f2d4
commit
d9973986d0
2 changed files with 3 additions and 1 deletions
|
|
@ -161,7 +161,7 @@ wn.ui.form.Attachments = Class.extend({
|
|||
},
|
||||
refresh_attachment_select_fields: function() {
|
||||
for(var i=0; i<this.frm.fields.length; i++) {
|
||||
if(this.frm.fields[i].df.options=="attach_files:") {
|
||||
if(this.frm.fields[i].df.options=="attach_files:" && this.frm.fields[i].$input) {
|
||||
var fieldname = this.frm.fields[i].df.fieldname;
|
||||
var selected_option = this.frm.fields[i].$input.find("option:selected").val();
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ wn.ui.form.Layout = Class.extend({
|
|||
fieldobj.docname = me.frm.docname;
|
||||
fieldobj.df = wn.meta.get_docfield(me.frm.doctype,
|
||||
fieldobj.df.fieldname, me.frm.docname);
|
||||
// on form change, permissions can change
|
||||
fieldobj.perm = me.frm.perm;
|
||||
fieldobj.refresh && fieldobj.refresh();
|
||||
});
|
||||
$(this.frm.wrapper).trigger("refresh-fields");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue