From b189fc46b051edc1d1fe4f2bd6b7d54bb0624cf5 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Mon, 11 Mar 2024 13:17:00 +0530 Subject: [PATCH] fix: submit JVs synchronously if in background job --- erpnext/accounts/doctype/journal_entry/journal_entry.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index 835d202c403..e6508b03cbf 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -158,14 +158,14 @@ class JournalEntry(AccountsController): validate_docs_for_deferred_accounting([self.name], []) def submit(self): - if len(self.accounts) > 100: + if len(self.accounts) > 100 and not frappe.job: msgprint(_("The task has been enqueued as a background job."), alert=True) self.queue_action("submit", timeout=4600) else: return self._submit() def cancel(self): - if len(self.accounts) > 100: + if len(self.accounts) > 100 and not frappe.job: msgprint(_("The task has been enqueued as a background job."), alert=True) self.queue_action("cancel", timeout=4600) else: