Skip to content

Commit 763919d

Browse files
authored
Remove Profile field (stale) from AnalysisRequest (#2211)
1 parent 07088f0 commit 763919d

File tree

3 files changed

+5
-27
lines changed

3 files changed

+5
-27
lines changed

CHANGES.rst

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Changelog
44
2.4.0 (unreleased)
55
------------------
66

7+
- #2211 Remove `Profile` field (stale) from AnalysisRequest
78
- #2207 Support for file upload on analysis (pre) conditions
89
- #2208 Remove `default_method` from AnalysisRequest's Contact field
910
- #2204 Fix traceback when retracting an analysis with a detection limit

src/bika/lims/content/analysisrequest.py

-23
Original file line numberDiff line numberDiff line change
@@ -396,29 +396,6 @@
396396
),
397397
),
398398

399-
# TODO Remove Profile field (in singular)
400-
ReferenceField(
401-
'Profile',
402-
allowed_types=('AnalysisProfile',),
403-
referenceClass=HoldingReference,
404-
relationship='AnalysisRequestAnalysisProfile',
405-
mode="rw",
406-
read_permission=View,
407-
write_permission=ModifyPortalContent,
408-
widget=ReferenceWidget(
409-
label=_("Analysis Profile"),
410-
description=_("Analysis profiles apply a certain set of analyses"),
411-
size=20,
412-
render_own_label=True,
413-
visible=False,
414-
catalog_name='senaite_catalog_setup',
415-
base_query={"is_active": True,
416-
"sort_on": "sortable_title",
417-
"sort_order": "ascending"},
418-
showOn=False,
419-
),
420-
),
421-
422399
ReferenceField(
423400
'Profiles',
424401
multiValued=1,

src/senaite/core/exportimport/setupdata/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -2280,13 +2280,13 @@ def Import(self):
22802280
getFullname=row['CCContact_Fullname'])[0].getObject()
22812281
obj.setCCContact(contact)
22822282
if row['AnalysisProfile_title']:
2283-
profile = pc(portal_type="AnalysisProfile",
2284-
title=row['AnalysisProfile_title'].getObject())
2285-
obj.setProfile(profile)
2283+
profiles = pc(portal_type="AnalysisProfile",
2284+
title=row['AnalysisProfile_title'])[0].getObject()
2285+
obj.setProfiles([profiles])
22862286
if row['ARTemplate_title']:
22872287
template = pc(portal_type="ARTemplate",
22882288
title=row['ARTemplate_title'])[0].getObject()
2289-
obj.setProfile(template)
2289+
obj.setTemplate(template)
22902290

22912291
obj.unmarkCreationFlag()
22922292

0 commit comments

Comments
 (0)