Skip to content

Commit

Permalink
fix: add route options for new Task
Browse files Browse the repository at this point in the history
  • Loading branch information
s-aga-r committed Nov 20, 2023
1 parent 331ad62 commit 2f3fc12
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions erpnext/projects/doctype/timesheet/timesheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ frappe.ui.form.on("Timesheet", {

frm.trigger('setup_filters');
frm.trigger('set_dynamic_field_label');
frm.trigger('set_route_options_for_new_task');
},

customer: function(frm) {
Expand Down Expand Up @@ -172,6 +173,14 @@ frappe.ui.form.on("Timesheet", {
frm.refresh_fields();
},

set_route_options_for_new_task: (frm) => {
let task_field = frm.get_docfield('time_logs', 'task');

if (task_field) {
task_field.get_route_options_for_new_doc = (row) => ({'project': row.doc.project});
}
},

make_invoice: function(frm) {
let fields = [{
"fieldtype": "Link",
Expand Down

0 comments on commit 2f3fc12

Please sign in to comment.