From bd487adca2eb3cfeba8d18fc5193b8862da71738 Mon Sep 17 00:00:00 2001 From: Casey Date: Wed, 18 Feb 2026 13:53:38 -0600 Subject: [PATCH] fix hooks --- custom_ui/hooks.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/custom_ui/hooks.py b/custom_ui/hooks.py index 50e0bf8..e82f612 100644 --- a/custom_ui/hooks.py +++ b/custom_ui/hooks.py @@ -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" }, {