diff --git a/public/js/legacy/widgets/form/fields.js b/public/js/legacy/widgets/form/fields.js index cd9c859e87..953fe2b981 100644 --- a/public/js/legacy/widgets/form/fields.js +++ b/public/js/legacy/widgets/form/fields.js @@ -182,7 +182,8 @@ Field.prototype.get_status = function() { ret = 'Read'; } // fields updated by workflow must be read-only - if(in_list(cur_frm.states.update_fields, this.df.fieldname)) { + if(in_list(cur_frm.states.update_fields, this.df.fieldname) || + this.df.fieldname==cur_frm.states.state_fieldname) { ret = 'Read'; } } diff --git a/public/js/wn/form/states.js b/public/js/wn/form/states.js index d2ebe1743d..af2ea78782 100644 --- a/public/js/wn/form/states.js +++ b/public/js/wn/form/states.js @@ -104,9 +104,11 @@ wn.ui.form.States = Class.extend({ .addClass("icon-" + state_doc.icon); // set the style - this.$wrapper.find(".btn:first").removeClass() - .addClass("btn dropdown-toggle") - .addClass("btn-" + state_doc.style.toLowerCase()); + var btn = this.$wrapper.find(".btn:first"); + btn.removeClass().addClass("btn dropdown-toggle") + + if(state_doc && state_doc.style) + btn.addClass("btn-" + state_doc.style.toLowerCase()); // show actions from that state this.show_actions(state);