feat: populate Timer dialog project field from Timesheet parent_project (backport #47971) (#48001)

feat: populate Timer dialog project field from Timesheet parent_project (#47971)

* feat: default parent project in timer dialog > project

* chore: fix formatting

* fix: remove unnecessary or condition

---------


(cherry picked from commit bc87609264)

Co-authored-by: Rahul Agrawal <12agrawalrahul@gmail.com>
Co-authored-by: Rahul Agrawal <deathstarconsole@Rahuls-MacBook-Air.local>
This commit is contained in:
mergify[bot]
2025-06-10 18:07:28 +05:30
committed by GitHub
parent 60b12b8319
commit 66b0426155

View File

@@ -18,7 +18,6 @@ erpnext.timesheet.timer = function (frm, row, timestamp = 0) {
{ fieldtype: "HTML", fieldname: "timer_html" },
],
});
if (row) {
dialog.set_values({
activity_type: row.activity_type,
@@ -26,6 +25,10 @@ erpnext.timesheet.timer = function (frm, row, timestamp = 0) {
task: row.task,
expected_hours: row.expected_hours,
});
} else {
dialog.set_values({
project: frm.doc.parent_project,
});
}
dialog.get_field("timer_html").$wrapper.append(get_timer_html());
function get_timer_html() {