from dependencies.dependency import ClassSecurityInfo from dependencies.dependency import BaseContent from dependencies.dependency import registerType from lims.content.bikaschema import BikaSchema from lims.config import PROJECTNAME schema = BikaSchema.copy() schema['description'].widget.visible = False schema['description'].schemata = 'default' class BatchLabel(BaseContent): security = ClassSecurityInfo() displayContentsTab = False schema = schema _at_rename_after_creation = True def _renameAfterCreation(self, check_auto_id=False): from lims.idserver import renameAfterCreation renameAfterCreation(self) registerType(BatchLabel, PROJECTNAME)
""" RejectAnalysis """ from dependencies.dependency import ReferenceField, Schema, registerType from lims.content.analysis import Analysis from lims.config import PROJECTNAME from lims.content.analysis import schema as analysis_schema schema = analysis_schema + Schema(( # The analysis that was originally rejected ReferenceField('Analysis', allowed_types=('Analysis',), relationship = 'RejectAnalysisAnalysis', ), )) class RejectAnalysis(Analysis): archetype_name = 'RejectAnalysis' schema = schema registerType(RejectAnalysis, PROJECTNAME)
schema['description'].schemata = 'default' schema['description'].widget.visible = True class SampleCondition(BaseFolder): security = ClassSecurityInfo() displayContentsTab = False schema = schema _at_rename_after_creation = True def _renameAfterCreation(self, check_auto_id=False): from lims.idserver import renameAfterCreation renameAfterCreation(self) registerType(SampleCondition, PROJECTNAME) def SampleConditions(self, instance=None, allow_blank=False): instance = instance or self bsc = getToolByName(instance, 'bika_setup_catalog') items = [] for sm in bsc(portal_type='SampleCondition', inactive_state='active', sort_on='sortable_title'): items.append((sm.UID, sm.Title)) items = allow_blank and [['', '']] + list(items) or list(items) return DisplayList(items)
)) schema['description'].schemata = 'default' schema['description'].widget.visible = True class SampleCondition(BaseFolder): security = ClassSecurityInfo() displayContentsTab = False schema = schema _at_rename_after_creation = True def _renameAfterCreation(self, check_auto_id=False): from lims.idserver import renameAfterCreation renameAfterCreation(self) registerType(SampleCondition, PROJECTNAME) def SampleConditions(self, instance=None, allow_blank=False): instance = instance or self bsc = getToolByName(instance, 'bika_setup_catalog') items = [] for sm in bsc(portal_type='SampleCondition', inactive_state='active', sort_on='sortable_title'): items.append((sm.UID, sm.Title)) items = allow_blank and [['', '']] + list(items) or list(items) return DisplayList(items)