From 8a331e0f261e668cee04f4e66f281ed7cd850ad7 Mon Sep 17 00:00:00 2001 From: Ritwik Puri Date: Tue, 11 Apr 2023 16:10:32 +0530 Subject: [PATCH] revert: remove frappe.send_message (v14) (#34816) revert: remove frappe.send_message --- erpnext/hooks.py | 4 ---- erpnext/public/js/website_utils.js | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/erpnext/hooks.py b/erpnext/hooks.py index c4032596f47a..f1ee370e97ee 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -30,10 +30,6 @@ override_doctype_class = {"Address": "erpnext.accounts.custom.address.ERPNextAddress"} -override_whitelisted_methods = { - "frappe.www.contact.send_message": "erpnext.templates.utils.send_message" -} - welcome_email = "erpnext.setup.utils.welcome_email" # setup wizard diff --git a/erpnext/public/js/website_utils.js b/erpnext/public/js/website_utils.js index 2bb5255eebc7..b5416065d791 100644 --- a/erpnext/public/js/website_utils.js +++ b/erpnext/public/js/website_utils.js @@ -3,6 +3,18 @@ if(!window.erpnext) window.erpnext = {}; +// Add / update a new Lead / Communication +// subject, sender, description +frappe.send_message = function(opts, btn) { + return frappe.call({ + type: "POST", + method: "erpnext.templates.utils.send_message", + btn: btn, + args: opts, + callback: opts.callback + }); +}; + erpnext.subscribe_to_newsletter = function(opts, btn) { return frappe.call({ type: "POST", @@ -12,3 +24,6 @@ erpnext.subscribe_to_newsletter = function(opts, btn) { callback: opts.callback }); } + +// for backward compatibility +erpnext.send_message = frappe.send_message;