From d06a4b6161bd07008ae6d576f76dd30ab9dd625b Mon Sep 17 00:00:00 2001 From: vishdha Date: Tue, 17 Aug 2021 16:25:48 +0530 Subject: [PATCH] chore: removed listview functionality from core and move it to erpnext --- .../public/js/purchase_order_list.js | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 bloomstack_core/public/js/purchase_order_list.js diff --git a/bloomstack_core/public/js/purchase_order_list.js b/bloomstack_core/public/js/purchase_order_list.js deleted file mode 100644 index d7b25ecd8..000000000 --- a/bloomstack_core/public/js/purchase_order_list.js +++ /dev/null @@ -1,38 +0,0 @@ -frappe.listview_settings['Purchase Order'].onload = - function (doclist) { - const action = () => { - const selected_docs = doclist.get_checked_items(); - const doctype = doclist.doctype; - if (selected_docs.length > 0) { - let title = selected_docs[0].title; - for (let doc of selected_docs) { - if (doc.docstatus !== 1) { - frappe.throw(__("Cannot Email Draft or cancelled documents")); - } - if (doc.title !== title) { - frappe.throw(__("Select only one Supplier's purchase orders")) - } - }; - frappe.call({ - method: "erpnext.utils.get_contact", - args: { "doctype": doctype, "name": selected_docs[0].name, "contact_field": "supplier" }, - callback: function (r) { - frappe.call({ - method: "erpnext.utils.get_document_links", - args: { "doctype": doctype, "docs": selected_docs }, - callback: function (res) { - new frappe.views.CommunicationComposer({ - subject: `${frappe.sys_defaults.company} - ${doctype} links`, - recipients: r.message ? r.message.email_id : null, - message: res.message, - doc: {} - }) - } - }) - } - }) - } - } - doclist.page.add_actions_menu_item(__('Email'), action, true); - } -