From 68a78d33d3ae1693be2af02b6090a5fe8152bf4a Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Mon, 11 Mar 2024 13:11:21 +0530 Subject: [PATCH] fix!: Enqueue action after commit --- frappe/model/document.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frappe/model/document.py b/frappe/model/document.py index e000923a10..8545161917 100644 --- a/frappe/model/document.py +++ b/frappe/model/document.py @@ -1536,11 +1536,16 @@ class Document(BaseDocument): primary_action=primary_action, ) + enqueue_after_commit = kwargs.pop("enqueue_after_commit", None) + if enqueue_after_commit is None: + enqueue_after_commit = True + return enqueue( "frappe.model.document.execute_action", __doctype=self.doctype, __name=self.name, __action=action, + enqueue_after_commit=enqueue_after_commit, **kwargs, )