fix hooks

This commit is contained in:
Casey 2026-02-18 13:53:38 -06:00
parent 33966decd9
commit bd487adca2

View File

@ -215,6 +215,13 @@ doc_events = {
}
}
# custom_ui/hooks.py (or a separate utils.py in the app)
def remove_fencing_job_queue_links(doc):
"""Remove links to the deleted 'Fencing Job Queue' doctype"""
links = doc.get("links", [])
doc["links"] = [l for l in links if l.get("link_doctype") != "Fencing Job Queue"]
fixtures = [
# {"dt": "Company"},
# {"dt": "Account"},
@ -233,10 +240,7 @@ fixtures = [
["custom", "=", 1],
["name", "!=", "Fencing Job Queue"],
["name", "!=", "Locate Log"], # <-- skip the deleted/removed doctype
],
"postprocess": lambda doc: doc.update(
{"links": [l for l in doc.get("links", []) if l.get("link_doctype") != "Fencing Job Queue"]}
)
]
},
{ "dt": "Task Type" },
{