mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-22 19:06:36 +00:00
fix: update the task status from timesheet
This commit is contained in:
@@ -199,8 +199,6 @@ class Task(NestedSet):
|
||||
self.name,
|
||||
as_dict=1,
|
||||
)[0]
|
||||
if self.status == "Open":
|
||||
self.status = "Working"
|
||||
self.total_costing_amount = tl.total_costing_amount
|
||||
self.total_billing_amount = tl.total_billing_amount
|
||||
self.actual_time = tl.time
|
||||
|
||||
@@ -126,6 +126,12 @@ class Timesheet(Document):
|
||||
if data.task and data.task not in tasks:
|
||||
task = frappe.get_doc("Task", data.task)
|
||||
task.update_time_and_costing()
|
||||
time_logs_completed = all(tl.completed for tl in self.time_logs if tl.task == task.name)
|
||||
|
||||
if time_logs_completed:
|
||||
task.status = "Completed"
|
||||
else:
|
||||
task.status = "Working"
|
||||
task.save()
|
||||
tasks.append(data.task)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user