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

Show Batch title or ID in Sample reference field #2654

Merged
merged 4 commits into from
Dec 11, 2024
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.6.0 (unreleased)
------------------

- #2654 Show Batch title or ID in Sample reference field
- #2657 Methods from analyses are not updated on instrument change in worksheet
- #2656 Fix AnalysisProfile keyword validator fail with non-ascii value
- #2646 Add SelectOtherField and SelectOtherWidget
Expand Down
2 changes: 1 addition & 1 deletion src/bika/lims/content/analysisrequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
{"name": "getClientBatchID", "label": _("CBID")},
{"name": "getClientTitle", "label": _("Client")},
],
ui_item="getId",
ui_item="Title",
)
),

Expand Down
6 changes: 6 additions & 0 deletions src/bika/lims/content/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ def _renameAfterCreation(self, check_auto_id=False):
from senaite.core.idserver import renameAfterCreation
renameAfterCreation(self)

def Title(self):
"""Returns the Title or ID
"""
title = self.getField("title").get(self)
return title or self.getId()

def getClient(self):
"""Retrieves the Client the current Batch is assigned to
"""
Expand Down