fix: clear asset custodian when asset take back from employee without assign to another employee

This commit is contained in:
KerollesFathy
2025-09-10 18:27:39 +03:00
parent 6245bf9b87
commit f4cdb49126

View File

@@ -144,6 +144,10 @@ class AssetMovement(Document):
if employee and employee != asset.custodian:
frappe.db.set_value("Asset", asset_id, "custodian", employee)
elif not employee and asset.custodian:
frappe.db.set_value("Asset", asset_id, "custodian", None)
if location and location != asset.location:
frappe.db.set_value("Asset", asset_id, "location", location)