Files
erpnext/erpnext/patches/v15_0/sync_auto_reconcile_config.py
ruthra kumar ea01fa135e fix: possible model sync issue
(cherry picked from commit 0069581aa3)
2025-02-11 04:25:34 +00:00

28 lines
893 B
Python

import frappe
from erpnext.accounts.utils import sync_auto_reconcile_config
def execute():
"""
Set default Cron Interval and Queue size
"""
frappe.db.set_single_value("Accounts Settings", "auto_reconciliation_job_trigger", 15)
frappe.db.set_single_value("Accounts Settings", "reconciliation_queue_size", 5)
# Create Scheduler Event record if it doesn't exist
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)