From c1a4c9eba68a28c98652b642b502cf6561df1ce8 Mon Sep 17 00:00:00 2001 From: cproudlock Date: Thu, 3 Sep 2026 17:08:03 -0400 Subject: [PATCH] Let a PC be assigned a business unit, and a retired asset be found The last two items from the run. The PC detail page has always rendered a Business Unit row, and the API has always accepted the field. Only the form had no control, so it could be read and never set from the UI - a value that appeared the moment somebody set it through the API and could not be reached otherwise. The form has the picker now, loaded with listAll() rather than a capped page. Global search excluded inactive assets, so a retired record existed, was reachable by URL, and could not be found by anybody who did not already know where it was - including whoever wanted to restore it, which the retire dialog promises they can. Retired assets are searchable now. That is only safe with the ordering, so it is part of the change rather than a follow-up: somebody searching a machine number almost always wants the machine still on the floor, so a retired match drops 60 points of relevance, sorts below every live one, and carries a 'retired' flag the results page renders as a badge. Indistinguishable retired results would be worse than none. Four tests, verified by planting the isactive filter back: three fail. Scope: product --- frontend/src/views/SearchResults.vue | 6 ++ plugins/computers/frontend/views/PCForm.vue | 33 +++++++++- shopdb/core/api/search.py | 25 +++++++- tests/test_core/test_search_retired.py | 69 +++++++++++++++++++++ 4 files changed, 127 insertions(+), 6 deletions(-) create mode 100644 tests/test_core/test_search_retired.py diff --git a/frontend/src/views/SearchResults.vue b/frontend/src/views/SearchResults.vue index 3e3d4b41..41f9985b 100644 --- a/frontend/src/views/SearchResults.vue +++ b/frontend/src/views/SearchResults.vue @@ -83,6 +83,12 @@ {{ result.location }} {{ result.ticketnumber }} Active + + retired