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

AN-145 initialise batch title field empty #2298

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 5 additions & 1 deletion bika/lims/content/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,13 @@ def _renameAfterCreation(self, check_auto_id=False):
def Title(self):
""" Return the Batch ID if title is not defined """
titlefield = self.Schema().getField('title')
if titlefield.widget.visible:
titlevalue = titlefield.get(self)
if titlefield.widget.visible and titlevalue:
return safe_unicode(self.title).encode('utf-8')
else:
pu = api.portal.get_tool("plone_utils")
if pu.isIDAutoGenerated(self.getId()):
return ''
return safe_unicode(self.id).encode('utf-8')

def _getCatalogTool(self):
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
3.4.0 (unreleased)
------------------

- AN-145: Set Initial value of Batch Title to empty string
- Issue-2320: AR Add: Copy of multiple ARs from different clients raises a Traceback in the background
- Issue-2317: AR Add fails if an Analysis Category was disabled
- Issue-2316: AR Add fails silently if e.g. the ID of the AR was already taken
Expand Down