fix(work order): Actual start and end dates update (#24360)

Currently, even when the Work Order (without Operations) is completed and Stock Entries are there, the Actual Start Date and Actual End Date is not updated. 

For some reason need to db_set, then it updates the Actual Start Date and Actual End Date
This commit is contained in:
Kanchan Chauhan 2021-01-13 20:59:43 +05:30 committed by GitHub
parent ef5f0c0461
commit 511434190d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -456,10 +456,10 @@ class WorkOrder(Document):
if data and len(data):
dates = [d.posting_datetime for d in data]
self.actual_start_date = min(dates)
self.db_set('actual_start_date', min(dates))
if self.status == "Completed":
self.actual_end_date = max(dates)
self.db_set('actual_end_date', max(dates))
self.set_lead_time()