diff --git a/erpnext/assets/doctype/asset_movement/asset_movement.py b/erpnext/assets/doctype/asset_movement/asset_movement.py index cfe9768ef4b..e1a1ce0871e 100644 --- a/erpnext/assets/doctype/asset_movement/asset_movement.py +++ b/erpnext/assets/doctype/asset_movement/asset_movement.py @@ -5,7 +5,7 @@ import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import get_link_to_form +from frappe.utils import cstr, get_link_to_form from erpnext.assets.doctype.asset_activity.asset_activity import add_asset_activity @@ -142,6 +142,7 @@ class AssetMovement(Document): def update_asset_location_and_custodian(self, asset_id, location, employee): asset = frappe.get_doc("Asset", asset_id) +<<<<<<< HEAD updates = {} if employee and employee != asset.custodian: updates["custodian"] = employee @@ -149,6 +150,10 @@ class AssetMovement(Document): elif not employee and asset.custodian: updates["custodian"] = "" +======= + if cstr(employee) != asset.custodian: + frappe.db.set_value("Asset", asset_id, "custodian", cstr(employee)) +>>>>>>> 323d8eaccd (fix(asset movement): clear custodian if not present) if location and location != asset.location: updates["location"] = location