From ea01fa135ee2ef0a467a97ba6dfb804926333f85 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 10 Feb 2025 17:15:28 +0530 Subject: [PATCH] fix: possible model sync issue (cherry picked from commit 0069581aa34ce72f17f7504d25f974a02c63b087) --- .../v15_0/sync_auto_reconcile_config.py | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/erpnext/patches/v15_0/sync_auto_reconcile_config.py b/erpnext/patches/v15_0/sync_auto_reconcile_config.py index 721364dcaa6..be92ad99536 100644 --- a/erpnext/patches/v15_0/sync_auto_reconcile_config.py +++ b/erpnext/patches/v15_0/sync_auto_reconcile_config.py @@ -11,16 +11,17 @@ def execute(): frappe.db.set_single_value("Accounts Settings", "reconciliation_queue_size", 5) # Create Scheduler Event record if it doesn't exist - method = "erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.trigger_reconciliation_for_queued_docs" - if not frappe.db.get_all( - "Scheduler Event", {"scheduled_against": "Process Payment Reconciliation", "method": method} - ): - frappe.get_doc( - { - "doctype": "Scheduler Event", - "scheduled_against": "Process Payment Reconciliation", - "method": method, - } - ).save() + if frappe.reload_doc("core", "doctype", "scheduler_event"): + method = "erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.trigger_reconciliation_for_queued_docs" + if not frappe.db.get_all( + "Scheduler Event", {"scheduled_against": "Process Payment Reconciliation", "method": method} + ): + frappe.get_doc( + { + "doctype": "Scheduler Event", + "scheduled_against": "Process Payment Reconciliation", + "method": method, + } + ).save() - sync_auto_reconcile_config(15) + sync_auto_reconcile_config(15)