Skip to content

Commit

Permalink
Show Batch title or ID in Sample reference field (#2654)
Browse files Browse the repository at this point in the history
* Show batch title or id in sample references

* Changelog updated
  • Loading branch information
ramonski authored Dec 11, 2024
1 parent 426827a commit c4c08d4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
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

0 comments on commit c4c08d4

Please sign in to comment.