fix: Don't set_status to 'Closed' when status is already "Closed" (#35621)

Co-authored-by: mgieger <mgieger@empirenatgas.com>
This commit is contained in:
MeIchthys 2026-01-05 13:08:30 +00:00 committed by GitHub
parent 80e158b533
commit 27f104bba6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -155,7 +155,7 @@ def close_all_assignments(doctype, name, ignore_permissions=False):
assignments = frappe.get_all(
"ToDo",
fields=["allocated_to", "name"],
filters=dict(reference_type=doctype, reference_name=name, status=("!=", "Cancelled")),
filters=dict(reference_type=doctype, reference_name=name, status=("not in", ["Cancelled", "Closed"])),
)
if not assignments:
return False