mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-19 21:19:19 +00:00
fix: update the task status from timesheet
This commit is contained in:
@@ -199,8 +199,6 @@ class Task(NestedSet):
|
|||||||
self.name,
|
self.name,
|
||||||
as_dict=1,
|
as_dict=1,
|
||||||
)[0]
|
)[0]
|
||||||
if self.status == "Open":
|
|
||||||
self.status = "Working"
|
|
||||||
self.total_costing_amount = tl.total_costing_amount
|
self.total_costing_amount = tl.total_costing_amount
|
||||||
self.total_billing_amount = tl.total_billing_amount
|
self.total_billing_amount = tl.total_billing_amount
|
||||||
self.actual_time = tl.time
|
self.actual_time = tl.time
|
||||||
|
|||||||
@@ -126,6 +126,12 @@ class Timesheet(Document):
|
|||||||
if data.task and data.task not in tasks:
|
if data.task and data.task not in tasks:
|
||||||
task = frappe.get_doc("Task", data.task)
|
task = frappe.get_doc("Task", data.task)
|
||||||
task.update_time_and_costing()
|
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()
|
task.save()
|
||||||
tasks.append(data.task)
|
tasks.append(data.task)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user