Merge pull request #26099 from rohitwaghchaure/enqueue-cancel-action-in-stock-reco-develop

fix: timeout while cancelling stock reconciliation
This commit is contained in:
rohitwaghchaure 2021-06-18 11:31:00 +05:30 committed by GitHub
commit e43df63978
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -473,6 +473,13 @@ class StockReconciliation(StockController):
else:
self._submit()
def cancel(self):
if len(self.items) > 100:
msgprint(_("The task has been enqueued as a background job. In case there is any issue on processing in background, the system will add a comment about the error on this Stock Reconciliation and revert to the Submitted stage"))
self.queue_action('cancel', timeout=2000)
else:
self._cancel()
@frappe.whitelist()
def get_items(warehouse, posting_date, posting_time, company):
lft, rgt = frappe.db.get_value("Warehouse", warehouse, ["lft", "rgt"])