fix(ux): Task creation from Timesheet (backport #38207) (#38211)

* fix(ux): enable `Quick Entry` for `Task`

(cherry picked from commit 331ad62f3c27a54e9d6bb49f1b70b169b633b3a6)

* fix: add route options for new `Task`

(cherry picked from commit 2f3fc12c08218ca06fbb911781090e619a88cf22)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
This commit is contained in:
mergify[bot] 2023-11-20 12:44:26 +05:30 committed by GitHub
parent 3f57a7e9f0
commit e272041872
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -57,6 +57,7 @@
],
"fields": [
{
"allow_in_quick_entry": 1,
"fieldname": "subject",
"fieldtype": "Data",
"in_global_search": 1,
@ -66,6 +67,7 @@
"search_index": 1
},
{
"allow_in_quick_entry": 1,
"bold": 1,
"fieldname": "project",
"fieldtype": "Link",
@ -396,7 +398,7 @@
"is_tree": 1,
"links": [],
"max_attachments": 5,
"modified": "2023-09-28 13:52:05.861175",
"modified": "2023-11-20 11:42:41.884069",
"modified_by": "Administrator",
"module": "Projects",
"name": "Task",
@ -416,6 +418,7 @@
"write": 1
}
],
"quick_entry": 1,
"search_fields": "subject",
"show_name_in_global_search": 1,
"show_preview_popup": 1,

View File

@ -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) {
@ -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",