Bug Fix (#20330)
* Bug Fix
auto_close_after_days field is in Selling Settings
* fix: close_opportunity_after_days field is in selling settings
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
diff --git a/erpnext/crm/doctype/opportunity/opportunity.py b/erpnext/crm/doctype/opportunity/opportunity.py
index 2880c80..5911db9 100644
--- a/erpnext/crm/doctype/opportunity/opportunity.py
+++ b/erpnext/crm/doctype/opportunity/opportunity.py
@@ -307,7 +307,7 @@
def auto_close_opportunity():
""" auto close the `Replied` Opportunities after 7 days """
- auto_close_after_days = frappe.db.get_value("Support Settings", "Support Settings", "close_opportunity_after_days") or 15
+ auto_close_after_days = frappe.db.get_single_value("Selling Settings", "close_opportunity_after_days") or 15
opportunities = frappe.db.sql(""" select name from tabOpportunity where status='Replied' and
modified<DATE_SUB(CURDATE(), INTERVAL %s DAY) """, (auto_close_after_days), as_dict=True)