mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 15:42:52 +00:00
fix: return None if document does not have status field in get_status… (#46415)
* fix: return None if document does not have status field in get_status function * chore: add comment
This commit is contained in:
@@ -220,7 +220,9 @@ class StatusUpdater(Document):
|
|||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
if self.doctype not in status_map:
|
if self.doctype not in status_map:
|
||||||
return {"status": self.status}
|
return {
|
||||||
|
"status": self.get("status")
|
||||||
|
} # sometimes status field is not present on certain DocTypes such as Stock Entry
|
||||||
|
|
||||||
sl = status_map[self.doctype][:]
|
sl = status_map[self.doctype][:]
|
||||||
sl.reverse()
|
sl.reverse()
|
||||||
@@ -562,6 +564,7 @@ class StatusUpdater(Document):
|
|||||||
target = frappe.get_doc(args["target_parent_dt"], args["name"])
|
target = frappe.get_doc(args["target_parent_dt"], args["name"])
|
||||||
target.update(update_data) # status calculus might depend on it
|
target.update(update_data) # status calculus might depend on it
|
||||||
status = target.get_status()
|
status = target.get_status()
|
||||||
|
if status.get("status"):
|
||||||
update_data.update(status)
|
update_data.update(status)
|
||||||
target.db_set(update_data, update_modified=update_modified, notify=True)
|
target.db_set(update_data, update_modified=update_modified, notify=True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user