Skip to content

Commit 1dfa970

Browse files
committed
Use flat_listing for the stored and past-retention sample listings
senaite.core #2976 replaces the wholesale root-ancestor removal with per-result orphan detection that nests a partition under its primary whenever both are in the same result set. The stored/past-retention listings are flat pools where every stored sample, partitions included, must appear on its own row, so declare them as flat listings via the 'flat_listing' review-state flag that senaite.core honours. This drops the dead 'flat_listing' adapter attribute and the manual isRootAncestor pop, which senaite.core now handles from the flag.
1 parent f9bd0a5 commit 1dfa970

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Changelog
44
2.7.0 (unreleased)
55
------------------
66

7+
- #74 Use flat_listing for the stored and past-retention sample listings
78
- #71 Fix UnicodeDecodeError when running migrate_storage_facility_to_dx
89
- #68 Require selection of retrieve reason when retrieving samples from storage
910
- #67 Rename "Recover" transtion to "Retrieve" to align with ISO 17025/15189

src/senaite/storage/adapters/listing.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@
9898
u"listing_samples_state_stored",
9999
default=u"Stored"
100100
),
101+
# flat pool: show every stored sample (partitions included) on its
102+
# own row, without nesting them under their primary
103+
"flat_listing": True,
101104
"contentFilter": {
102105
"review_state": ("stored",),
103106
"sort_on": "created",
@@ -112,6 +115,9 @@
112115
u"listing_samples_state_past_retention",
113116
default=u"Past Retention"
114117
),
118+
# flat pool: show every stored sample (partitions included) on its
119+
# own row, without nesting them under their primary
120+
"flat_listing": True,
115121
"contentFilter": {
116122
"review_state": ("stored",),
117123
"sort_on": "getStorageExpiryDate",
@@ -139,7 +145,6 @@ def __init__(self, listing, context):
139145
self.listing = listing
140146
self.context = context
141147
self.installed = is_installed()
142-
self.flat_listing = False
143148

144149
@property
145150
def warning_days_before_expiration(self):
@@ -164,10 +169,10 @@ def before_render(self):
164169
# Additional custom transitions
165170
map(self.add_custom_transition, ADD_CUSTOM_TRANSITIONS)
166171

167-
# In "stored" status, display all samples in "flat style"
168-
if self.is_stored_state():
169-
self.flat_listing = True
170-
self.listing.contentFilter.pop("isRootAncestor", None)
172+
# The "stored" and "past_retention" review states are flagged as
173+
# flat listings (see their `flat_listing` key), so senaite.core drops
174+
# the root-ancestor restriction and renders every stored sample,
175+
# partitions included, on its own row without nesting.
171176

172177
# Update the contentFilter of the "past_retention" filter, so only
173178
# stored samples whose retention period has passed are displayed

0 commit comments

Comments
 (0)