Bläddra i källkod

workflow:ignore idx

version-14
Rushabh Mehta 12 år sedan
förälder
incheckning
00b25a6e40
2 ändrade filer med 5 tillägg och 3 borttagningar
  1. +1
    -0
      core/doctype/custom_field/custom_field.py
  2. +4
    -3
      core/doctype/workflow/workflow.py

+ 1
- 0
core/doctype/custom_field/custom_field.py Visa fil

@@ -72,6 +72,7 @@ class DocType:
webnotes.clear_cache(doctype=self.doc.dt)

def create_property_setter(self):
if not self.doc.insert_after: return
idx_label_list, field_list = get_fields_label(self.doc.dt, 0)
label_index = idx_label_list.index(self.doc.insert_after)
if label_index==-1: return


+ 4
- 3
core/doctype/workflow/workflow.py Visa fil

@@ -31,9 +31,10 @@ class DocType:
self.create_custom_field_for_workflow_state()
def create_custom_field_for_workflow_state(self):
webnotes.clear_cache(doctype=self.doc.document_type)
doctypeobj = webnotes.get_doctype(self.doc.document_type)
if not doctypeobj.get({"doctype":"DocField",
"fieldname":self.doc.workflow_state_field}):
if not len(doctypeobj.get({"doctype":"DocField",
"fieldname":self.doc.workflow_state_field})):
# create custom field
webnotes.model_wrapper([{
@@ -45,7 +46,7 @@ class DocType:
"hidden": 1,
"fieldtype": "Link",
"options": "Workflow State",
"insert_after": doctypeobj.get({"doctype":"DocField"})[-1].label
#"insert_after": doctypeobj.get({"doctype":"DocField"})[-1].fieldname
}]).save()
webnotes.msgprint("Created Custom Field '%s' in '%s'" % (self.doc.workflow_state_field,


Laddar…
Avbryt
Spara