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

---------

Co-authored-by: Rahul Agrawal <deathstarconsole@Rahuls-MacBook-Air.local>
This commit is contained in:
Rahul Agrawal
2025-06-10 18:02:05 +05:30
committed by GitHub
parent 4e537cdb74
commit bc87609264

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() {