From bd055ab78c884b569bb9d2e82f24215a08d73de2 Mon Sep 17 00:00:00 2001 From: rehansari26 Date: Mon, 28 Apr 2025 16:41:53 +0530 Subject: [PATCH] fix: create custom field when doctype is changed --- frappe/workflow/doctype/workflow/workflow.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frappe/workflow/doctype/workflow/workflow.py b/frappe/workflow/doctype/workflow/workflow.py index 5376c675d1..985bb95475 100644 --- a/frappe/workflow/doctype/workflow/workflow.py +++ b/frappe/workflow/doctype/workflow/workflow.py @@ -35,11 +35,9 @@ class Workflow(Document): self.set_active() self.validate_docstatus() - def after_insert(self): - self.create_custom_field_for_workflow_state() - def on_update(self): frappe.clear_cache(doctype=self.document_type) + self.create_custom_field_for_workflow_state() self.update_default_workflow_status() def create_custom_field_for_workflow_state(self):