From 30fe711c44561c1e5752276bdfc7af44ab2ac695 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 12:12:04 +0000 Subject: [PATCH] fix(support-settings): disable the auto-close tickets feature if `close_issue_after_days` is set to 0 (backport #53499) (#53504) Co-authored-by: diptanilsaha fix(support-settings): disable the auto-close tickets feature if `close_issue_after_days` is set to 0 (#53499) --- erpnext/support/doctype/issue/issue.py | 12 ++++++++---- .../doctype/support_settings/support_settings.json | 6 ++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/erpnext/support/doctype/issue/issue.py b/erpnext/support/doctype/issue/issue.py index b6023b47e76..70ced430257 100644 --- a/erpnext/support/doctype/issue/issue.py +++ b/erpnext/support/doctype/issue/issue.py @@ -227,10 +227,14 @@ def set_status(name, status): def auto_close_tickets(): - """Auto-close replied support tickets after 7 days""" - auto_close_after_days = ( - frappe.db.get_value("Support Settings", "Support Settings", "close_issue_after_days") or 7 - ) + """ + Auto-close replied support tickets as defined on `close_issue_after_days` in Support Settings. + Disables the feature if `close_issue_after_days` is set to 0. + """ + auto_close_after_days = frappe.db.get_single_value("Support Settings", "close_issue_after_days") + + if not auto_close_after_days: + return table = frappe.qb.DocType("Issue") issues = ( diff --git a/erpnext/support/doctype/support_settings/support_settings.json b/erpnext/support/doctype/support_settings/support_settings.json index bf1daa16f86..cbc727309bb 100644 --- a/erpnext/support/doctype/support_settings/support_settings.json +++ b/erpnext/support/doctype/support_settings/support_settings.json @@ -37,9 +37,11 @@ }, { "default": "7", + "description": "Set this value to 0 to disable the feature.", "fieldname": "close_issue_after_days", "fieldtype": "Int", - "label": "Close Issue After Days" + "label": "Close Issue After Days", + "non_negative": 1 }, { "fieldname": "portal_sb", @@ -163,7 +165,7 @@ ], "issingle": 1, "links": [], - "modified": "2021-10-14 13:08:38.473616", + "modified": "2026-03-16 16:33:45.859541", "modified_by": "Administrator", "module": "Support", "name": "Support Settings",