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" }, {