refactor: handle Issue and Lead separately on Communication

This commit is contained in:
ruthra kumar 2024-09-05 12:29:45 +05:30
parent 8dd14c4ba8
commit 1456f42c68

View file

@ -668,7 +668,14 @@ def update_parent_document_on_communication(doc):
options = (status_field.options or "").splitlines()
# if status has a "Open" option and status is "Replied", then update the status for received communication
if ("Open" in options) and parent.status == "Replied" and doc.sent_or_received == "Received":
if (
("Open" in options)
and parent.status == "Replied"
and doc.sent_or_received == "Received"
or (
parent.doctype == "Issue" and ("Open" in options) and doc.sent_or_received == "Received"
) # For 'Issue', current status is not considered.
):
parent.db_set("status", "Open")
parent.run_method("handle_hold_time", "Replied")
apply_assignment_rule(parent)