Merge pull request #23764 from anupamvs/project-timesheet

fix: added project link in timesheet form
This commit is contained in:
rohitwaghchaure 2020-11-09 17:34:11 +05:30 committed by GitHub
commit 8d39d7570a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 320 additions and 1086 deletions

View File

@ -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