@@ -161,6 +161,7 @@ class DocType: | |||||
validate_fields_for_doctype(self.doc.doc_type) | validate_fields_for_doctype(self.doc.doc_type) | ||||
webnotes.clear_cache(doctype=self.doc.doc_type) | webnotes.clear_cache(doctype=self.doc.doc_type) | ||||
webnotes.msgprint("Updated") | |||||
def diff(self, new_dl, ref_dl, dt_dl): | def diff(self, new_dl, ref_dl, dt_dl): | ||||
@@ -177,13 +177,13 @@ Field.prototype.get_status = function() { | |||||
} | } | ||||
// workflow state | // workflow state | ||||
if(ret=="Write" && cur_frm && cur_frm.states.state_fieldname) { | |||||
if(ret=="Write" && cur_frm && cur_frm.state_fieldname) { | |||||
if(cur_frm.read_only) { | if(cur_frm.read_only) { | ||||
ret = 'Read'; | ret = 'Read'; | ||||
} | } | ||||
// fields updated by workflow must be read-only | // 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) { | |||||
this.df.fieldname==cur_frm.state_fieldname) { | |||||
ret = 'Read'; | ret = 'Read'; | ||||
} | } | ||||
} | } | ||||
@@ -103,7 +103,8 @@ _f.Frm.prototype.setup = function() { | |||||
var me = this; | var me = this; | ||||
this.fields = []; | this.fields = []; | ||||
this.fields_dict = {}; | this.fields_dict = {}; | ||||
this.state_fieldname = wn.workflow.get_state_fieldname(this.doctype); | |||||
// wrapper | // wrapper | ||||
this.wrapper = this.parent; | this.wrapper = this.parent; | ||||
@@ -466,6 +466,14 @@ $.extend(_p, { | |||||
} | } | ||||
var h2 = $a(me.layout.cur_row.header, 'div', '', h2_style); | var h2 = $a(me.layout.cur_row.header, 'div', '', h2_style); | ||||
h2.innerHTML = docname; | h2.innerHTML = docname; | ||||
if(cur_frm.state_fieldname) { | |||||
$a(h2, 'br'); | |||||
var span = $a(h2, 'span', '', | |||||
{padding: "3px", color: "#fff", backgroundColor: "#777", | |||||
display:"inline-block"}); | |||||
span.innerHTML = cur_frm.doc[cur_frm.state_fieldname]; | |||||
} | |||||
}, | }, | ||||
build_data: function(data, doctype, docname) { | build_data: function(data, doctype, docname) { | ||||