Hi everyone, I am looking to add new fields to Sample, by developing a custom_lims add on to modify Sample and Patient fields. The problem is I cannot access ISample or Sample (commented below). Can someone who went through this help me? I am working with docker image of 2.x.
extender.py ----->
from zope.interface import implements
from zope.component import adapts
from plone.app.content.interfaces import INameFromTitle
from bika.lims.content.sample import Sample # does not work
from bika.lims.interfaces import ISample # does not work
from senaite.core.interfaces import ISamples # does not work
from senaite.lims.content.sample import Sample # does not work
from archetypes.schemaextender.interfaces import ISchemaExtender, IBrowserLayerAwareExtender
from archetypes.schemaextender.interfaces import ISchemaModifier
from Products.Archetypes import atapi
from custom.lims.interfaces import ICustomLimsLayer # your browser layer
class SampleExtender(object):
implements(ISchemaExtender, IBrowserLayerAwareExtender)
adapts(ISample)
layer = ICustomLimsLayer
def init(self, context):
self.context = context
def getFields(self):
return [
atapi.StringField(
“SampleSource”,
required=False,
searchable=True,
schemata=“Sample”,
widget=atapi.StringWidget(
label=“Sample Source”,
description=“Enter the source of the sample”,
),
)
]
docker-compose.yaml ---->
senaite:
image: senaite/senaite:2.x
ports:
- “8082:8080”
volumes:
- senaite_data:/data
- ./src:/home/senaite/senaitelims/src
- ./src:/plone/instance/src
restart: unless-stopped
environment:
ADDONS: “senaite.patient custom.lims”
SOURCES: |
senaite.patient=git GitHub - senaite/senaite.patient: Patient handling for SENAITE branch=master
custom.lims=fs custom.lims path=src/.