fix: replaced add doctype button with select group button

This commit is contained in:
Shariq Ansari 2023-05-26 20:42:43 +05:30
parent 2af7e74eb9
commit ac3fb73702

View file

@ -0,0 +1,25 @@
frappe.listview_settings["DocType"] = {
onload: function (me) {
me.page.btn_primary.addClass("hidden");
let actions = [
{
label: __("Add DocType"),
description: __("Create a new DocType"),
action: () => frappe.new_doc("DocType"),
},
{
label: __("Add DocType (Form Builder)"),
description: __("Use the form builder to create a new DocType"),
action: () => frappe.set_route("form-builder", "new-doctype"),
},
];
frappe.utils.add_select_group_button(
me.page.btn_primary.parent(),
actions,
"btn-primary",
"add"
);
},
};