From e1e25a0c9d87abb4b92fe053876ac73f465b7649 Mon Sep 17 00:00:00 2001 From: mbauskar Date: Thu, 16 Feb 2017 19:36:59 +0530 Subject: [PATCH] [minor] auto close opportunity after 7 days --- erpnext/crm/doctype/opportunity/opportunity.py | 10 ++++++++++ erpnext/hooks.py | 1 + erpnext/patches.txt | 3 ++- erpnext/public/js/utils/party.js | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/erpnext/crm/doctype/opportunity/opportunity.py b/erpnext/crm/doctype/opportunity/opportunity.py index 301dc825e0..be857b5580 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.py +++ b/erpnext/crm/doctype/opportunity/opportunity.py @@ -245,3 +245,13 @@ def set_multiple_status(names, status): opp = frappe.get_doc("Opportunity", name) opp.status = status opp.save() + +def auto_close_opportunity(): + """ auto close the `Replied` Opportunities after 7 days """ + opportunities = frappe.db.sql(""" select name from tabOpportunity where status='Replied' and + modifiedmodified") \ No newline at end of file diff --git a/erpnext/public/js/utils/party.js b/erpnext/public/js/utils/party.js index a1d200f6ef..35d0b4203f 100644 --- a/erpnext/public/js/utils/party.js +++ b/erpnext/public/js/utils/party.js @@ -129,7 +129,7 @@ erpnext.utils.get_contact_details = function(frm) { if(frm.doc["contact_person"]) { frappe.call({ - method: "erpnext.utilities.doctype.contact.contact.get_contact_details", + method: "frappe.email.doctype.contact.contact.get_contact_details", args: {contact: frm.doc.contact_person }, callback: function(r) { if(r.message)