workflow updates: update_field not editable & bug fix

This commit is contained in:
Rushabh Mehta 2013-01-09 19:12:47 +05:30
parent f50e801bf5
commit e6fba1a210
2 changed files with 7 additions and 4 deletions

View file

@ -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';
}
}

View file

@ -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);