Merge pull request #39612 from frappe/mergify/bp/version-15-hotfix/pr-39562

fix: enqueue JV submission when > 100 accounts (backport #39562)
This commit is contained in:
Gursheen Kaur Anand 2024-01-29 11:55:58 +05:30 committed by GitHub
commit daafe45dd4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -150,6 +150,20 @@ class JournalEntry(AccountsController):
if not self.title:
self.title = self.get_title()
def submit(self):
if len(self.accounts) > 100:
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:
msgprint(_("The task has been enqueued as a background job."), alert=True)
self.queue_action("cancel", timeout=4600)
else:
return self._cancel()
def on_submit(self):
self.validate_cheque_info()
self.check_credit_limit()