feat: added project link in timesheet form
This commit is contained in:
parent
ae6a51b83a
commit
9002904131
@ -133,6 +133,11 @@ frappe.ui.form.on("Timesheet", {
|
||||
frm: frm
|
||||
});
|
||||
},
|
||||
|
||||
project: function(frm) {
|
||||
set_project_in_timelog(frm);
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
frappe.ui.form.on("Timesheet Detail", {
|
||||
@ -162,7 +167,11 @@ frappe.ui.form.on("Timesheet Detail", {
|
||||
frappe.model.set_value(cdt, cdn, "hours", hours);
|
||||
},
|
||||
|
||||
time_logs_add: function(frm) {
|
||||
time_logs_add: function(frm, cdt, cdn) {
|
||||
if(frm.doc.project) {
|
||||
frappe.model.set_value(cdt, cdn, 'project', frm.doc.project);
|
||||
}
|
||||
|
||||
var $trigger_again = $('.form-grid').find('.grid-row').find('.btn-open-row');
|
||||
$trigger_again.on('click', () => {
|
||||
$('.form-grid')
|
||||
@ -297,3 +306,9 @@ const set_employee_and_company = function(frm) {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function set_project_in_timelog(frm) {
|
||||
if(frm.doc.project){
|
||||
erpnext.utils.copy_value_in_all_rows(frm.doc, frm.doc.doctype, frm.doc.name, "time_logs", "project");
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user