fix: update project cost from timesheet (backport #44211) (#44212)

fix: update project cost from timesheet (#44211)

(cherry picked from commit b21fb8f8b6)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot]
2024-11-19 22:59:16 +05:30
committed by GitHub
parent 704452a9fa
commit ad0c65500a

View File

@@ -169,10 +169,14 @@ class Timesheet(Document):
task.save()
tasks.append(data.task)
elif data.project and data.project not in projects:
frappe.get_doc("Project", data.project).update_project()
if data.project and data.project not in projects:
projects.append(data.project)
for project in projects:
project_doc = frappe.get_doc("Project", project)
project_doc.update_project()
project_doc.save()
def validate_dates(self):
for data in self.time_logs:
if data.from_time and data.to_time and time_diff_in_hours(data.to_time, data.from_time) < 0: