Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
get_portal_type takes a brain or object and not context
oh sorry my mistake get_portal_type isn't the problem but self.context returns a registry object type on http://localhost:8080/mysite/portal_registry
(Pdb) self.context
<plone.app.registry.registry.Registry object at 0x7f21fe3f7ed0 oid 0x1cece in <Connection at 7f220e93d2d0>>

maybe https://github.com/senaite/senaite.core/blob/2.x/src/senaite/core/browser/bootstrap/bootstrap.py#L159

  "data-portal-type": api.get_portal_type(self.context),

can be replaced with

  "data-portal-type": self.context.portal_type,
Ramon Bartl
Hi @Lunga001, thanks for finding this out. I'll add a fixture today for this in the core. Would you mind to add an issue in the tracker?
Berchie Agyemang Nti
I get the error below when click on Configure Registry (I am using the docker Image of senaite:V2.3.0):
We’re sorry, but there seems to be an error…

Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 162, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 371, in publish_module
  Module ZPublisher.WSGIPublisher, line 274, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 63, in call_object
  Module plone.app.registry.browser.records, line 208, in __call__
  Module z3c.form.form, line 239, in __call__
  Module z3c.form.form, line 163, in render
  Module Products.Five.browser.pagetemplatefile, line 126, in __call__
  Module Products.Five.browser.pagetemplatefile, line 61, in __call__
  Module zope.pagetemplate.pagetemplate, line 135, in pt_render
  Module Products.PageTemplates.engine, line 378, in __call__
  Module z3c.pt.pagetemplate, line 176, in render
  Module chameleon.zpt.template, line 302, in render
  Module chameleon.template, line 215, in render
  Module chameleon.template, line 192, in render
  Module 5dcfdfbaf6651d02557d99d6e1d7d5f5, line 1527, in render
  Module a78c3433348e8ed1014bc14c60a3717b, line 382, in render_master
  Module ebc65d336ed6a24c5f619c027b166db6, line 1065, in render_master
  Module zope.tales.pythonexpr, line 73, in __call__
   - __traceback_info__: (bootstrapview.get_data_settings())
  Module <string>, line 1, in <module>
  Module senaite.core.browser.bootstrap.bootstrap, line 159, in get_data_settings
  Module bika.lims.api, line 472, in get_portal_type
  Module bika.lims.api, line 347, in fail
APIError: <plone.app.registry.registry.Registry object at 0x401b647e50 oid 0xc30 in <Connection at 4014546a90>> is not supported.

 - Expression: "  python:bootstrapview.get_data_settings"
 - Filename:   ... te/core/browser/main_template/templates/main_template.pt
 - Location:   (line 65: col 24)
 - Source:     cls python:bootstrapview.get_columns_classes(view)"
 - Expression: "context/@@main_template/macros/master"
 - Filename:   ... aite/core/skins/senaite_templates/prefs_main_template.pt
 - Location:   (line 2: col 30)
 - Source:     ... tal:use-macro="context/@@main_template/macros/master">
 - Expression: "here/prefs_main_template/macros/master"
 - Filename:   ... y2.7.egg/plone/app/registry/browser/templates/records.pt
 - Location:   (line 6: col 23)
 - Source:     ... al:use-macro="here/prefs_main_template/macros/master"
 - Arguments:  repeat: <Products.PageTemplates.engine.RepeatDictWrapper object at 0x402a026190>
               template: <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x4032df3210>
               views: <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x40298dc410>
               request: <WSGIRequest, URL=http://localhost:8086/bnitmsenaite/portal_registry/@@configuration_registry>
               args: ()
               here: <plone.app.registry.registry.Registry object at 0x401b647e50 oid 0xc30 in <Connection at 4014546a90>>
               user: <PropertiedUser 'admin'>
               nothing: None
               translate: <function translate at 0x40297d99d0>
               container: <plone.app.registry.registry.Registry object at 0x401b647e50 oid 0xc30 in <Connection at 4014546a90>>
               root: <Application at >
               modules: <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter object at 0x40063a0d50>
               options: {}
               traverse_subpath: []
               default: <DEFAULT>
               loop: {}
               context: <plone.app.registry.registry.Registry object at 0x401b647e50 oid 0xc30 in <Connection at 4014546a90>>
               view: <Products.Five.browser.metaconfigure.RecordsControlPanel object at 0x4029911810>
               target_language: None
               macroname: u'master'
               attrs: {}
Ramon Bartl
see above
Ramon Bartl
@Lunga001, @Berchie: senaite/senaite.core#2158
If you depend on it, you need to use the 2.x docker image instead of the tagged v2.3.0 after it has been merged.
ok cool, thank you @ramonski
Ramon Bartl
Here you see which PRs are baked into the docker image 2.x or edge already since the version bump to 2.4.0: https://github.com/senaite/senaite.core/actions/workflows/docker.yml
Berchie Agyemang Nti
Thank you @ramonski
Hi all,
I'm using senaite 2.x and trying to implement a referral module, any solution??
Thanks in advance.
in the docker ,how to change the toolbar logo in Senaite 2.3?
Ramon Bartl
@crazy_babaq_twitter: You can go to http://<your-senaite-site>/setup to change the logo
Jeff Bullard
I'm programming a template in Senaite.Impress to get QC section for Reference Analyses to show up on teh report. In model.py I have the reference analyses objects (for example <ReferenceAnalysis at SA-100>). But I can't figure out how to get the Expected Value, Min and Max from there.
vars() on the Reference Analysis object gives me this, but no min, max and expected value:
Jeff Bullard

{'Category': u'da1107d98a0e455da8648cb92c33aabf', 'ReferenceAnalysesGroupID': u'QC-007-001', 'LowerDetectionLimitSoil': u'2.5', 'Uncertainties': [], '_signature': '\xa1\x83\xcb\x0c\x01\xc0\t\xfd\xd1V\xf8\xab\xfdYP\x06', 'SortKey': None, 'marshall_hook': None, 'RetractedAnalysesPdfReport': <plone.app.blob.field.BlobWrapper object at 0x7f7b485497d0>, 'Attachment': [], 'Department': u'371de92094ac41e1b904c48b0f80647c', 'DuplicateVariation': (0, 0), '_senaite_core__Field__Edit_Analysis_Hidden_Permission': ('LabManager', 'Manager', 'LabClerk', 'Publisher'), '_at_creation_flag': False, 'title': u'Sulfate', 'demarshall_hook': None, 'ProtocolID': u'EPA 9038', 'id': 'SA-100', 'Precision': 1, '__provides__': <zope.interface.Provides object at 0x7f7b4854b610>, 'SurrogateRawSpike': (0, 0), 'DilutionFactor': (1, 0), 'FinalAmount': (250, 0), '_EtagSupport__etag': 'ts65281572.92', 'SurrogateLimitsSoil': u'', 'Analyst': u'', 'UpperDetectionLimit': (1000000000, 0), 'Keyword': u'sulfate', 'NumberOfRequiredVerifications': 1, '__annotations__': <BTrees.OOBTree.OOBTree object at 0x7f7b48549a50>, 'portal_type': 'ReferenceAnalysis', 'Multiplier': (10, 0), '_at_uid': '613faa816ef441eeac9d9a675ca19ac0', 'ResultAnalysisDate': None, 'at_references': <Folder at at_references>, '_Modify_portal_content_Permission': (), 'DetectionLimitOperand': u'', 'VAT': (0, 0), 'PrecisionFromUncertainty': False, 'AnalysisService': u'87e212b493264fc297fecfaf88752596', 'InterimFields': [], 'InitAmount': (25, 0), 'ScientificName': False, 'RawResult': (18, 66), 'Unit': u'mg/L', 'RawQuantLimit': (5, 0), 'RetestOf': u'', 'ShortTitle': u'', 'BulkPrice': (0, 0), 'ExponentialFormatPrecision': 7, 'creation_date': DateTime('2019/02/11 17:47:18.397642 US/Central'), 'Instrument': u'1c500ae80fae431d8186d033e710f3fc', 'StringResult': False, 'SurrogateLimitsWater': u'', 'AnalysisFlag': u'', 'Hidden': False, 'PointOfCapture': u'lab', 'UpperDetectionLimitSoil': (1000000000, 0), '_senaite_core__Edit_Results_Permission': (), 'ResultCaptureDate': DateTime('2022/10/09 02:07:36.419525 UTC'), 'MaxTimeAllowed': {'hours': '0', 'minutes': '0', 'days': '5'}, 'modification_date': DateTime('2022/09/19 12:58:28.465855 GMT-5'), 'RawDetectionLimit': (2, 5000000), 'workflow_history': {'bika_referenceanalysis_workflow': ({'action': None, 'review_state': 'assigned', 'actor': 'jeffb', 'comments': '', 'time': DateTime('2022/10/09 02:04:40.461077 UTC')}, {'action': 'submit', 'review_state': 'to_be_verified', 'actor': 'jeffb', 'comments': '', 'time': DateTime('2022/10/09 02:07:36.423109 UTC')}, {'action': 'verify', 'review_state': 'verified', 'actor': 'jeffb', 'comments': '', 'time': DateTime('2022/10/09 02:12:52.777264 UTC')})}, 'ResultOptions': [], 'Method': u'b67a778abde54d9dbd414a38f68af7d9', 'RawDetectionLimitSoil': (2, 5000000), 'Remarks': <BaseUnit at Remarks>, 'CommercialID': u'', '_senaite_core__Field__Edit_Analysis_Result_Permission': (), 'AllowManualDetectionLimit': False, 'AttachmentOption': u'p', 'ResultsRange': {}, 'Accredited': False, 'Surrogate': False, 'Uncertainty': None, '_senaite_core__View_Results_Permission': ('Analyst', 'LabClerk', 'LabManager', 'Manager', 'RegulatoryInspector'), 'Price': (35, 0), 'ReferenceType': u'c', 'LowerDetectionLimit': u'25', 'SoilUnit': u'ppm', 'InstrumentEntryOfResults': True, 'ManualEntryOfResults': True, 'DetectionLimitSelector': False, 'AdjustResult': u'True', '_senaite_core__Field__Edit_Analysis_Remarks_Permission': (), 'Result': u'187', '_md': {'effectiveDate': None, 'language': u'en', 'rights': <BaseUnit at rights>, 'subject': (), 'location': u'', 'expirationDate': None, 'contributors': (), 'allowDiscussion': None, 'creators': (u'admin',), 'description': <BaseUnit at description>}, '__ac_local_roles__': {'jeffb': ['Owner']}, 'AllowManualUncertainty': False, 'SelfVerification': -1}

hello,everyone!I install senaite on unbuntu18.04, refer to the documentation https://www.senaite.com/docs/installation .``` (base) senaite@senaite-OptiPlex-7060:~/senaitelims$ PYTHONHTTPSVERIFY=0
buildoutInstalling instance.
Installing instance.

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/home/senaite/miniconda2/lib/python2.7/site-packages/zc/buildout/buildout.py", line 2174, in main
getattr(buildout, command)(args)
File "/home/senaite/miniconda2/lib/python2.7/site-packages/zc/buildout/buildout.py", line 817, in install
installed_files = self[part]._call(recipe.install)
File "/home/senaite/miniconda2/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1603, in _call
return f()
File "/home/senaite/buildout-cache/eggs/plone.recipe.zope2instance-4.4.1-py2.7.egg/plone/recipe/zope2instance/init.py", line 169, in install
File "/home/senaite/buildout-cache/eggs/plone.recipe.zope2instance-4.4.1-py2.7.egg/plone/recipe/zope2instance/init.py", line 668, in install_scripts
requirements, ws = self.egg.working_set(['plone.recipe.zope2instance'])
File "/home/senaite/buildout-cache/eggs/zc.recipe.egg-1.3.2-py2.7.egg/zc/recipe/egg/egg.py", line 101, in working_set
File "/home/senaite/miniconda2/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 957, in install
return installer.install(specs, working_set)
File "/home/senaite/miniconda2/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 674, in install
for spec in specs]
File "/home/senaite/miniconda2/lib/python2.7/site-packages/pkg_resources/init.py", line 2995, in parse
req, = parse_requirements(s)
File "/home/senaite/miniconda2/lib/python2.7/site-packages/pkg_resources/init.py", line 2942, in parse_requirements
yield Requirement(line)
File "/home/senaite/miniconda2/lib/python2.7/site-packages/pkg_resources/init.py", line 2951, in init
raise RequirementParseError(str(e))
RequirementParseError: Invalid requirement, parse error at "'='"

Albion Shala
Hi everyone...
Is someone here who tried installing Senaite in the AWS EC2 instance?
Since I cannot find any documentation on how I can do that, I wanted to ask someone for help in this regard (where can I find such documentation)
Berchie Agyemang Nti

Getting error when importing the senaite setup load

Error Traceback (most recent call last): File "/home/senaite/senaitelims/src/senaite.core/src/senaite/core/browser/form/adapters/data_import.py", line 43, in handle_data_import LoadSetupData(self.context, self.request)() File "/home/senaite/senaitelims/src/senaite.core/src/senaite/core/exportimport/load_setup_data.py", line 119, in call adapter(self, workbook, self.dataset_project, self.dataset_name) File "/home/senaite/senaitelims/src/senaite.core/src/senaite/core/exportimport/setupdata/init.py", line 115, in call self.Import() File "/home/senaite/senaitelims/src/senaite.core/src/senaite/core/exportimport/setupdata/init.py", line 546, in Import raise Exception(message) Exception: Client %s has no Name

Can any help with this error? the clients' sheet has a Name column.

@ramonski Hello! I hope you can update the SENAITE installation tutorial on the official website.https://www.senaite.com/docs/installation

@crazy_babaq_twitter Here is an UNOFFICIAL document I put together for everyone struggling to figure out how to install senaite for the first time with no knowledge of LINUX or cloud or anything. Hope it helps:

An Easy, Beginner's Guide, .Step-by-Step Senaite Cloud Install with Digital Ocean and Docker

Follow the Regular Senaite Documentation from there!
@albionshala See my previous post.
@noblelabs1 Thank you for your reply! Is there any document directly installed on Ubuntu 22.04?
@crazy_babaq_twitter You can follow the docker compose instructions ti insall on ubuntu locally.
Or follow the cirrent documentation using python 2.7 environment
@noblelabs1 thanks
Hi All,
How do you reload Senaite when developing?
Currently to implement changes I am restarting my Docker container. I would like to be able to hot reload to implement code changes. Failing that It would be great to reload Senaite via the browser, similar to the process described for plone.reload (https://github.com/plone/plone.reload).
Thank you.
Hi All. I’m considering implementing Bika or Senaite in a clinical chemistry lab. Has anyone implemented Senaite / Bika in a working Clinical chemistry laboratory that can give me a demo of their setup? The workflow in Senaite / Bika is very much worksheet orientated, or single instance sample oriented, rather than patient orientated. With this I mean focus is placed on working with a batch of samples from 1 client, or working with a single sample belonging to 1 client.
As background to my question:
In clinical laboratories, the move towards automated random access analysers has shifted the focus to working with a single sample (belonging to a patient), rather than necessarily worksheets which has different patients on them. The sample is processed as a “worksheet” in itself as all analyses on that sample needs to be done as soon as possible. This can be done well in senaite with just omitting the assigning of a sample to a worksheet.
The samples for a single patient can be done by a range of different doctors (clients in Senaite’s case). The results of the patient should be grouped, and not necessarily only grouped in the “Clients” view tab – as patients move from clinicians quite often. Can this results view be setup somehow, either on a Senaite.listing interface or on the COA via senaite.impress? One needs to be able to see the “Patient’s” previous result on the COA.
Any help in this regard will be highly appreciated.
1 reply
Screenshot 2022-10-31 at 11.18.44 AM.png
(base) senaite@senaite-OptiPlex-7060:~/Plone-5.2.9-UnifiedInstaller$ ./install.sh standalone --target=/home/senaite --instance=senaitelims --password=admin --with-python=/home/senaite/miniconda2/envs/senaite/bin/python2.7

Testing /home/senaite/miniconda2/envs/senaite/bin/python2.7 for Zope/Plone requirements....
/home/senaite/miniconda2/envs/senaite/bin/python2.7 looks OK. We will use it.

Rootless install method chosen. Will install for use by system user senaite

Detailed installation log being written to /home/senaite/Plone-5.2.9-UnifiedInstaller/install.log
Installing Plone 5.2.9 at /home/senaite

Creating Python virtual environment.
New python executable in /home/senaite/senaitelims/bin/python2.7
Also creating executable in /home/senaite/senaitelims/bin/python
Installing setuptools, pip, wheel...
Installing Python requirements in virtual environment.
Unable to install Python requirements in virtual environment.

Installation has failed.
See the detailed installation log at /home/senaite/Plone-5.2.9-UnifiedInstaller/install.log
to determine the cause.
What's wrong?
install.log is
Creating Python virtual environment.
Virtualenv successfully created
Installing Python requirements in virtual environment.
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error(0, 'Error'))': /release/5.2.9/requirements.txt
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error(0, 'Error'))': /release/5.2.9/requirements.txt
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error(0, 'Error'))': /release/5.2.9/requirements.txt
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error(0, 'Error'))': /release/5.2.9/requirements.txt
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error(0, 'Error'))': /release/5.2.9/requirements.txt
ERROR: Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='dist.plone.org', port=443): Max retries exceeded with url: /release/5.2.9/requirements.txt (Caused by ProxyError('Cannot connect to proxy.', error(0, 'Error')))

Unable to install Python requirements in virtual environment.
Ronald Munjoma
Hi @crazy_babaq_twitter please check your internet connection. Are you behind a proxy ? Caused by ProxyError('Cannot connect to proxy.', error(0, 'Error')))
Vishal Singh
Is it possible to add BikaListingView in the Edit Client preferences options

Greetings to all. I'd like to add the analyst signature to the published report. i tried the following and it isn't working. any pointers are well appreciated on moving this forward. thanks again.

<tal:analysts repeat="analyst python:model.getAnalysts()">
<td style="border:none">
<img tal:condition="analysts/Signature|nothing" tal:attributes="src string:${analysts/absolute_url}/Signature" style="height:35px"/>
<div class="font-weight-bold">
<span tal:content="analysts/Salutation|nothing"></span>
<span tal:condition="analysts/Salutation|nothing"> </span>
<span tal:content="analysts/Fullname|nothing"></span>
<span tal:content="analysts/JobTitle|nothing"></span>
<span tal:content="analysts/DefaultDepartment/title|nothing"></span>

Stefan Gruber
My blind guess: Try calling the fields in singular form analyst/[fieldname] instead of plural analysts/[fieldname]..
7 replies
Hi guys, I am still a noob using working with Senaite. Is there a function that can get user info(SuperModel instance) using just their username? Any pointers would help ;)

Is there a way to prevent the duplication of Batch objects into the same UID when they are created?

In our laboratory's case, a Batch is created for every request. A request would sometimes contain more than one sample. The certificate to publish would always contain all of the samples in the request. This is the reason why a new batch is always created per request.

No errors are reported while the Batch is created, and the analyses are performed, submitted and verified. However, when the users try to publish a certificate, this error sometimes appears:


It happens about once a month, as reported by the users. Is there a way to prevent it from happening?

Johan Fick
I am new to Senaite LIMS. I was wondering, is it possible to add attachments to e.g. the Clients profile (additional documentation of the client)?

Hello everyone,

It seems that for a while now there is no history awareness / versioning on ASs? So once an AS keyword has been used, it cannot be edited, https://mysite.com/bika_setup/bika_analysisservices/analysisservice-12, and a message, ‘Keyword is used in active analyses and can not be changed anymore’ is displayed
I have a case now where an instrument will be used to capture some results which were done manually before with arbitrary keyword , e.g. ControllerConductivity. In the instrument’s import file conductivity_from_controller is used and i want to edit the AS Keyword to match
Would that be possible at all under any circumstances? Say once all the Sample using the analysis are cancelled or published.
Only way out seems that i have to deactivate these and create new ASs with the correct keywords ( but then all of Profiles, Calculations, Reference Definitions, Specifications and Worksheet Templates are affected and the AS have to be replaced there too

Stefan Gruber
Hello @Lunga001 I also wondered about the AS keyword being not editable any longer. Since 2.x? I don't know exactly. IIRC it was editable earlier and IMHO it should be editable again. I suppose it wasn't a real problem, was it?
Ramon Bartl
@Lunga001, @grulisco: The active analyses have to be just cancelled, then it is possible again to edit the keyword
Stefan Gruber
@ramonski charming...
Hi guys, check out this week's blog: https://senaite.hashnode.dev/setting-up-digital-ocean-for-senaite-installation
I would love to add any of you to the hashnode team publication in case you is interested in contributing to the community through blog articles.
Hello, would you guys be interested in joining a webinar hosted by a volunteer in the community on the process of creating an egg and integrating it with Senaite? Also, is there anyone who would like volunteer to lead the session?
1 reply
Ronald Munjoma
Hi @iamwangwe_twitter by egg are you referring to a Senaite add on?
1 reply
Abdelmonem Abuelezz (HawkMedia)
Assalmo Alykum