Hello
I’m facing an issue with workflow state changes in Frappe.
When I apply a workflow on a custom DocType, the workflow_state
field changes properly when I approve/reject using workflow actions. However, I noticed that my validate
and on_update
methods are not getting triggered when the state changes only via workflow.
For example, in my DocType’s Python class:
class CustomDoc(Document):
def validate(self):
frappe.msgprint("Validate called")
def on_update(self):
frappe.msgprint("On Update called")
When I change normal fields and save → these methods run fine.
But when I change the state using a workflow action (e.g. Approve/Reject) → these methods do not always run.