feat(Asset Repair): Change Asset's status according to repair_status

This commit is contained in:
GangaManoj 2021-05-11 18:43:36 +05:30
parent 1c26b27a89
commit 30c4a56491

View File

@ -13,6 +13,10 @@ class AssetRepair(Document):
if self.repair_status == "Completed" and not self.completion_date:
frappe.throw(_("Please select Completion Date for Completed Repair"))
if self.repair_status == 'Pending':
frappe.db.set_value('Asset', self.asset, 'status', 'Out of Order')
else:
frappe.db.set_value('Asset', self.asset, 'status', 'Submitted')
@frappe.whitelist()
def get_downtime(failure_date, completion_date):