mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 04:09:11 +00:00
Parse left out time (#14586)
This commit is contained in:
@@ -122,24 +122,26 @@ frappe.ui.form.on("Project Task", {
|
|||||||
});
|
});
|
||||||
|
|
||||||
frappe.ui.form.on("Project", "validate", function (frm) {
|
frappe.ui.form.on("Project", "validate", function (frm) {
|
||||||
frappe.call({
|
if (frm.doc.collect_progress == 1) {
|
||||||
method: "erpnext.projects.doctype.project.project.times_check",
|
frappe.call({
|
||||||
args: {
|
method: "erpnext.projects.doctype.project.project.times_check",
|
||||||
"from1": frm.doc.from,
|
args: {
|
||||||
"to": frm.doc.to,
|
"from1": frm.doc.from,
|
||||||
"first_email": frm.doc.first_email,
|
"to": frm.doc.to,
|
||||||
"second_email": frm.doc.second_email,
|
"first_email": frm.doc.first_email,
|
||||||
"daily_time_to_send": frm.doc.daily_time_to_send,
|
"second_email": frm.doc.second_email,
|
||||||
"weekly_time_to_send": frm.doc.weekly_time_to_send
|
"daily_time_to_send": frm.doc.daily_time_to_send,
|
||||||
|
"weekly_time_to_send": frm.doc.weekly_time_to_send
|
||||||
|
|
||||||
},
|
},
|
||||||
callback: function (r) {
|
callback: function (r) {
|
||||||
frm.set_value("from", r.message.from1);
|
frm.set_value("from", r.message.from1);
|
||||||
frm.set_value("to", r.message.to);
|
frm.set_value("to", r.message.to);
|
||||||
frm.set_value("first_email", r.message.first_email);
|
frm.set_value("first_email", r.message.first_email);
|
||||||
frm.set_value("second_email", r.message.second_email);
|
frm.set_value("second_email", r.message.second_email);
|
||||||
frm.set_value("daily_time_to_send", r.message.daily_time_to_send);
|
frm.set_value("daily_time_to_send", r.message.daily_time_to_send);
|
||||||
frm.set_value("weekly_time_to_send", r.message.weekly_time_to_send);
|
frm.set_value("weekly_time_to_send", r.message.weekly_time_to_send);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
@@ -363,17 +363,17 @@ def weekly():
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def times_check(from1, to, first_email, second_email, daily_time_to_send, weekly_time_to_send):
|
def times_check(from1, to, first_email, second_email, daily_time_to_send, weekly_time_to_send):
|
||||||
from1 = datetime.datetime.strptime(from1, "%H:%M:%S")
|
from1 = datetime.datetime.strptime(from1, "%H:%M:%S.%f")
|
||||||
from1 = from1.strftime("%H:00:00")
|
from1 = from1.strftime("%H:00:00")
|
||||||
to = datetime.datetime.strptime(to, "%H:%M:%S")
|
to = datetime.datetime.strptime(to, "%H:%M:%S.%f")
|
||||||
to = to.strftime("%H:00:00")
|
to = to.strftime("%H:00:00")
|
||||||
first_email = datetime.datetime.strptime(first_email, "%H:%M:%S")
|
first_email = datetime.datetime.strptime(first_email, "%H:%M:%S.%f")
|
||||||
first_email = first_email.strftime("%H:00:00")
|
first_email = first_email.strftime("%H:00:00")
|
||||||
second_email = datetime.datetime.strptime(second_email, "%H:%M:%S")
|
second_email = datetime.datetime.strptime(second_email, "%H:%M:%S.%f")
|
||||||
second_email = second_email.strftime("%H:00:00")
|
second_email = second_email.strftime("%H:00:00")
|
||||||
daily_time_to_send = datetime.datetime.strptime(daily_time_to_send, "%H:%M:%S")
|
daily_time_to_send = datetime.datetime.strptime(daily_time_to_send, "%H:%M:%S.%f")
|
||||||
daily_time_to_send = daily_time_to_send.strftime("%H:00:00")
|
daily_time_to_send = daily_time_to_send.strftime("%H:00:00")
|
||||||
weekly_time_to_send = datetime.datetime.strptime(weekly_time_to_send, "%H:%M:%S")
|
weekly_time_to_send = datetime.datetime.strptime(weekly_time_to_send, "%H:%M:%S.%f")
|
||||||
weekly_time_to_send = weekly_time_to_send.strftime("%H:00:00")
|
weekly_time_to_send = weekly_time_to_send.strftime("%H:00:00")
|
||||||
return {"from1": from1, "to": to, "first_email": first_email, "second_email": second_email,"daily_time_to_send": daily_time_to_send, "weekly_time_to_send": weekly_time_to_send}
|
return {"from1": from1, "to": to, "first_email": first_email, "second_email": second_email,"daily_time_to_send": daily_time_to_send, "weekly_time_to_send": weekly_time_to_send}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user