mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-20 13:39:18 +00:00
fix: submit JVs synchronously if in background job
This commit is contained in:
@@ -158,14 +158,14 @@ class JournalEntry(AccountsController):
|
|||||||
validate_docs_for_deferred_accounting([self.name], [])
|
validate_docs_for_deferred_accounting([self.name], [])
|
||||||
|
|
||||||
def submit(self):
|
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)
|
msgprint(_("The task has been enqueued as a background job."), alert=True)
|
||||||
self.queue_action("submit", timeout=4600)
|
self.queue_action("submit", timeout=4600)
|
||||||
else:
|
else:
|
||||||
return self._submit()
|
return self._submit()
|
||||||
|
|
||||||
def cancel(self):
|
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)
|
msgprint(_("The task has been enqueued as a background job."), alert=True)
|
||||||
self.queue_action("cancel", timeout=4600)
|
self.queue_action("cancel", timeout=4600)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user