fix: timeout while cancelling stock reconciliation

This commit is contained in:
Rohit Waghchaure 2021-06-18 10:11:53 +05:30
parent d17217c4e2
commit ef97269386

View File

@ -473,6 +473,13 @@ class StockReconciliation(StockController):
else: else:
self._submit() 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() @frappe.whitelist()
def get_items(warehouse, posting_date, posting_time, company): def get_items(warehouse, posting_date, posting_time, company):
lft, rgt = frappe.db.get_value("Warehouse", warehouse, ["lft", "rgt"]) lft, rgt = frappe.db.get_value("Warehouse", warehouse, ["lft", "rgt"])