mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 17:04:47 +00:00
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
This commit is contained in:
@@ -147,29 +147,32 @@ frappe.ui.form.on("Project", {
|
|||||||
set_project_status_button: function (frm) {
|
set_project_status_button: function (frm) {
|
||||||
frm.add_custom_button(
|
frm.add_custom_button(
|
||||||
__("Set Project Status"),
|
__("Set Project Status"),
|
||||||
() => {
|
() => frm.events.get_project_status_dialog(frm).show(),
|
||||||
let d = new frappe.ui.Dialog({
|
|
||||||
title: __("Set Project Status"),
|
|
||||||
fields: [
|
|
||||||
{
|
|
||||||
fieldname: "status",
|
|
||||||
fieldtype: "Select",
|
|
||||||
label: "Status",
|
|
||||||
reqd: 1,
|
|
||||||
options: "Completed\nCancelled",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
primary_action: function () {
|
|
||||||
frm.events.set_status(frm, d.get_values().status);
|
|
||||||
d.hide();
|
|
||||||
},
|
|
||||||
primary_action_label: __("Set Project Status"),
|
|
||||||
}).show();
|
|
||||||
},
|
|
||||||
__("Actions")
|
__("Actions")
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
get_project_status_dialog: function (frm) {
|
||||||
|
const dialog = new frappe.ui.Dialog({
|
||||||
|
title: __("Set Project Status"),
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
fieldname: "status",
|
||||||
|
fieldtype: "Select",
|
||||||
|
label: "Status",
|
||||||
|
reqd: 1,
|
||||||
|
options: "Completed\nCancelled",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
primary_action: function () {
|
||||||
|
frm.events.set_status(frm, dialog.get_values().status);
|
||||||
|
dialog.hide();
|
||||||
|
},
|
||||||
|
primary_action_label: __("Set Project Status"),
|
||||||
|
});
|
||||||
|
return dialog;
|
||||||
|
},
|
||||||
|
|
||||||
create_duplicate: function (frm) {
|
create_duplicate: function (frm) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
frappe.prompt("Project Name", (data) => {
|
frappe.prompt("Project Name", (data) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user