Просмотр исходного кода

workflow updates: added workflow state to standard print format

version-14
Rushabh Mehta 12 лет назад
Родитель
Сommit
cbefeee47d
4 измененных файлов: 13 добавлений и 3 удалений
  1. +1
    -0
      core/doctype/customize_form/customize_form.py
  2. +2
    -2
      public/js/legacy/widgets/form/fields.js
  3. +2
    -1
      public/js/legacy/widgets/form/form.js
  4. +8
    -0
      public/js/legacy/widgets/form/print_format.js

+ 1
- 0
core/doctype/customize_form/customize_form.py Просмотреть файл

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


+ 2
- 2
public/js/legacy/widgets/form/fields.js Просмотреть файл

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


+ 2
- 1
public/js/legacy/widgets/form/form.js Просмотреть файл

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


+ 8
- 0
public/js/legacy/widgets/form/print_format.js Просмотреть файл

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


Загрузка…
Отмена
Сохранить