From 53e18a5b7959709a3c442d885cb6757454df79d4 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 4 Nov 2024 17:56:30 +0530 Subject: [PATCH] chore: remove background job --- .../payment_request/payment_request.py | 28 ------------------- erpnext/hooks.py | 1 - 2 files changed, 29 deletions(-) diff --git a/erpnext/accounts/doctype/payment_request/payment_request.py b/erpnext/accounts/doctype/payment_request/payment_request.py index 3e7529efcc6b..5ca56b1ab6a6 100644 --- a/erpnext/accounts/doctype/payment_request/payment_request.py +++ b/erpnext/accounts/doctype/payment_request/payment_request.py @@ -968,31 +968,3 @@ def get_irequests_of_payment_request(doc: str | None = None) -> list: }, ) return res - - -def get_all_irequests_of_cancelled_payment_request() -> list: - res = [] - - pr = qb.DocType("Payment Request") - if payment_requests := qb.from_(pr).select(pr.name).where(pr.docstatus.eq(2)).run(as_list=True): - # - payment_requests = [x[0] for x in payment_requests] - - res = frappe.db.get_all( - "Integration Request", - { - "reference_doctype": "Payment Request", - "reference_docname": ["in", payment_requests], - "status": "Queued", - }, - ) - return res - - -def cancel_integration_requests_of_cancelled_payment_requests(): - """ - Primarily used by background job - """ - integration_requests = get_all_irequests_of_cancelled_payment_request() - for ireq in integration_requests: - frappe.db.set_value("Integration Request", ireq.name, "status", "Cancelled") diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 074d6187b9ff..059075fe321d 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -399,7 +399,6 @@ "0/15 * * * *": [ "erpnext.manufacturing.doctype.bom_update_log.bom_update_log.resume_bom_cost_update_jobs", "erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.trigger_reconciliation_for_queued_docs", - "erpnext.accounts.doctype.payment_request.payment_request.cancel_integration_requests_of_cancelled_payment_requests", ], "0/30 * * * *": [ "erpnext.utilities.doctype.video.video.update_youtube_data",