Merge pull request #23764 from anupamvs/project-timesheet
fix: added project link in timesheet form
This commit is contained in:
commit
8d39d7570a
@ -133,6 +133,11 @@ frappe.ui.form.on("Timesheet", {
|
|||||||
frm: frm
|
frm: frm
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
project: function(frm) {
|
||||||
|
set_project_in_timelog(frm);
|
||||||
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
frappe.ui.form.on("Timesheet Detail", {
|
frappe.ui.form.on("Timesheet Detail", {
|
||||||
@ -162,7 +167,11 @@ frappe.ui.form.on("Timesheet Detail", {
|
|||||||
frappe.model.set_value(cdt, cdn, "hours", hours);
|
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');
|
var $trigger_again = $('.form-grid').find('.grid-row').find('.btn-open-row');
|
||||||
$trigger_again.on('click', () => {
|
$trigger_again.on('click', () => {
|
||||||
$('.form-grid')
|
$('.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