Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Profile field (stale) from AnalysisRequest #2211

Merged
merged 2 commits into from
Dec 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
2.4.0 (unreleased)
------------------

- #2211 Remove `Profile` field (stale) from AnalysisRequest
- #2207 Support for file upload on analysis (pre) conditions
- #2208 Remove `default_method` from AnalysisRequest's Contact field
- #2204 Fix traceback when retracting an analysis with a detection limit
Expand Down
23 changes: 0 additions & 23 deletions src/bika/lims/content/analysisrequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,29 +396,6 @@
),
),

# TODO Remove Profile field (in singular)
ReferenceField(
'Profile',
allowed_types=('AnalysisProfile',),
referenceClass=HoldingReference,
relationship='AnalysisRequestAnalysisProfile',
mode="rw",
read_permission=View,
write_permission=ModifyPortalContent,
widget=ReferenceWidget(
label=_("Analysis Profile"),
description=_("Analysis profiles apply a certain set of analyses"),
size=20,
render_own_label=True,
visible=False,
catalog_name='senaite_catalog_setup',
base_query={"is_active": True,
"sort_on": "sortable_title",
"sort_order": "ascending"},
showOn=False,
),
),

ReferenceField(
'Profiles',
multiValued=1,
Expand Down
8 changes: 4 additions & 4 deletions src/senaite/core/exportimport/setupdata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2280,13 +2280,13 @@ def Import(self):
getFullname=row['CCContact_Fullname'])[0].getObject()
obj.setCCContact(contact)
if row['AnalysisProfile_title']:
profile = pc(portal_type="AnalysisProfile",
title=row['AnalysisProfile_title'].getObject())
obj.setProfile(profile)
profiles = pc(portal_type="AnalysisProfile",
title=row['AnalysisProfile_title'])[0].getObject()
obj.setProfiles([profiles])
if row['ARTemplate_title']:
template = pc(portal_type="ARTemplate",
title=row['ARTemplate_title'])[0].getObject()
obj.setProfile(template)
obj.setTemplate(template)

obj.unmarkCreationFlag()

Expand Down