Files
erpnext/erpnext/public/js/event.js
mergify[bot] 7d3d2eb928 ci: add prettier to pre-commit (backport #40206) (#40362)
* ci: add prettier to pre-commit

(cherry picked from commit 2c16036ef3)

* style: format js files

---------

Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
Co-authored-by: Ankush Menat <ankush@frappe.io>
2024-03-11 10:47:18 +05:30

56 lines
1.2 KiB
JavaScript

// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
// MIT License. See license.txt
frappe.provide("frappe.desk");
frappe.ui.form.on("Event", {
refresh: function (frm) {
frm.set_query("reference_doctype", "event_participants", function () {
return {
filters: {
name: ["in", ["Contact", "Lead", "Customer", "Supplier", "Employee", "Sales Partner"]],
},
};
});
frm.add_custom_button(
__("Add Leads"),
function () {
new frappe.desk.eventParticipants(frm, "Lead");
},
__("Add Participants")
);
frm.add_custom_button(
__("Add Customers"),
function () {
new frappe.desk.eventParticipants(frm, "Customer");
},
__("Add Participants")
);
frm.add_custom_button(
__("Add Suppliers"),
function () {
new frappe.desk.eventParticipants(frm, "Supplier");
},
__("Add Participants")
);
frm.add_custom_button(
__("Add Employees"),
function () {
new frappe.desk.eventParticipants(frm, "Employee");
},
__("Add Participants")
);
frm.add_custom_button(
__("Add Sales Partners"),
function () {
new frappe.desk.eventParticipants(frm, "Sales Partners");
},
__("Add Participants")
);
},
});