from bika.lims.interfaces import IDuplicateAnalysis from bika.lims.subscribers import skip from Products.Archetypes.config import REFERENCE_CATALOG from Products.Archetypes.public import * from Products.Archetypes.references import HoldingReference from Products.CMFCore.utils import getToolByName from zope.interface import implements schema = schema.copy() + Schema(( ReferenceField( 'Analysis', required=1, allowed_types=('Analysis', ), referenceClass=HoldingReference, relationship='DuplicateAnalysisAnalysis', ), InterimFieldsField('InterimFields', ), StringField( 'Result', ), StringField('ResultDM', ), BooleanField('Retested', ), ReferenceField( 'Attachment', multiValued=1, allowed_types=('Attachment', ), referenceClass=HoldingReference, relationship='DuplicateAnalysisAttachment', ), StringField('Analyst', ), ReferenceField( 'Instrument', required=0, allowed_types=('Instrument', ), relationship='AnalysisInstrument', referenceClass=HoldingReference, ),
from bika.lims.subscribers import skip from Products.Archetypes.config import REFERENCE_CATALOG from Products.Archetypes.public import * from Products.Archetypes.references import HoldingReference from Products.CMFCore.utils import getToolByName from zope.interface import implements schema = schema.copy() + Schema(( ReferenceField( 'Analysis', required=1, allowed_types=('Analysis', ), referenceClass=HoldingReference, relationship='DuplicateAnalysisAnalysis', ), InterimFieldsField('InterimFields', ), StringField('Result', ), StringField('ResultDM', ), BooleanField('Retested', ), ReferenceField( 'Attachment', multiValued=1, allowed_types=('Attachment', ), referenceClass=HoldingReference, relationship='DuplicateAnalysisAttachment', ), StringField('Analyst', ), ReferenceField( 'Instrument', required=0, allowed_types=('Instrument', ),
widget = SelectionWidget( label = _("Reference Type"), ), ), HistoryAwareReferenceField('Service', required = 1, allowed_types = ('AnalysisService',), relationship = 'ReferenceAnalysisAnalysisService', referenceClass = HoldingReference, widget = ReferenceWidget( label = _("Analysis Service"), ) ), InterimFieldsField('InterimFields', widget = BikaRecordsWidget( label = _("Calculation Interim Fields"), ) ), StringField('Result', widget = StringWidget( label = _("Result"), ) ), StringField('ResultDM', ), ReferenceField('Attachment', multiValued = 1, allowed_types = ('Attachment',), referenceClass = HoldingReference, relationship = 'ReferenceAnalysisAttachment', ),
from Products.CMFCore.utils import getToolByName from Products.CMFCore.WorkflowCore import WorkflowException from zExceptions import Redirect from zope.interface import implements import sys import re import transaction schema = BikaSchema.copy() + Schema(( InterimFieldsField( 'InterimFields', schemata='Calculation', widget=BikaRecordsWidget( label=_("Calculation Interim Fields"), description= _("Define interim fields such as vessel mass, dilution factors, " "should your calculation require them. The field title specified " "here will be used as column headers and field descriptors where " "the interim fields are displayed. If 'Apply wide' is enabled " "the field ill be shown in a selection box on the top of the " "worksheet, allowing to apply a specific value to all the " "corresponding fields on the sheet."), )), HistoryAwareReferenceField( 'DependentServices', schemata='Calculation', required=1, multiValued=1, vocabulary_display_path_bound=sys.maxsize, allowed_types=('AnalysisService', ), relationship='CalculationAnalysisService', referenceClass=HoldingReference,
# the calculation at creation time. Calculation = HistoryAwareReferenceField('Calculation', allowed_types=('Calculation', ), relationship='AnalysisCalculation', referenceClass=HoldingReference) # InterimFields are defined in Calculations, Services, and Analyses. # In Analysis Services, the default values are taken from Calculation. # In Analyses, the default values are taken from the Analysis Service. # When instrument results are imported, the values in analysis are overridden # before the calculation is performed. InterimFields = InterimFieldsField( 'InterimFields', schemata='Method', widget=RecordsWidget( label=_("Calculation Interim Fields"), description=_( "Values can be entered here which will override the defaults " "specified in the Calculation Interim Fields."), )) schema = schema.copy() + Schema(( AnalysisService, Analyst, Attachment, DetectionLimitOperand, # NumberOfRequiredVerifications overrides AbstractBaseClass NumberOfRequiredVerifications, Result, ResultCaptureDate, Retested,
Calculation = HistoryAwareReferenceField('Calculation', allowed_types=('Calculation', ), relationship='AnalysisCalculation', referenceClass=HoldingReference) # InterimFields are defined in Calculations, Services, and Analyses. # In Analysis Services, the default values are taken from Calculation. # In Analyses, the default values are taken from the Analysis Service. # When instrument results are imported, the values in analysis are overridden # before the calculation is performed. InterimFields = InterimFieldsField( 'InterimFields', read_permission=View, write_permission=FieldEditAnalysisResult, schemata='Method', widget=RecordsWidget( label=_("Calculation Interim Fields"), description=_( "Values can be entered here which will override the defaults " "specified in the Calculation Interim Fields."), )) schema = schema.copy() + Schema(( AnalysisService, Analyst, Attachment, DetectionLimitOperand, # NumberOfRequiredVerifications overrides AbstractBaseClass NumberOfRequiredVerifications, Result, ResultCaptureDate,
from bika.lims.browser.fields import HistoryAwareReferenceField from bika.lims.config import PROJECTNAME from bika.lims.content.bikaschema import BikaSchema from zope.interface import implements from zope.site.hooks import getSite from zExceptions import Redirect import sys, re from bika.lims import PMF, bikaMessageFactory as _ schema = BikaSchema.copy() + Schema(( InterimFieldsField( 'InterimFields', schemata=PMF('Calculation'), widget=BikaRecordsWidget( label=_("Calculation Interim Fields"), description= _("Define interim fields such as vessel mass, dilution factors, " "should your calculation require them. The field title specified " "here will be used as column headers and field descriptors where " "the interim fields are displayed"), )), HistoryAwareReferenceField( 'DependentServices', schemata=PMF('Calculation'), required=1, multiValued=1, vocabulary_display_path_bound=sys.maxint, allowed_types=('AnalysisService', ), relationship='CalculationAnalysisService', referenceClass=HoldingReference, widget=ReferenceWidget(
# bika.lims imports from bika.lims.config import PROJECTNAME from bika.lims import bikaMessageFactory as _ from bika.lims.interfaces import ICalculation from bika.lims.content.bikaschema import BikaSchema schema = BikaSchema.copy() + Schema(( InterimFieldsField( 'InterimFields', widget=BikaRecordsWidget( label=_("Calculation Interim Fields"), description=_( """Define interim fields such as vessel mass, dilution factors, should your calculation require them. The field title specified here will be used as column headers and field descriptors where the interim fields are displayed. If 'Apply wide' is enabled the field will be shown in a selection box on the top of the worksheet, allowing to apply a specific value to all the corresponding fields on the sheet. <br /> Hidden fields will not be shown in the results capture options. """), )), HistoryAwareReferenceField( 'DependentServices', required=1, multiValued=1, vocabulary_display_path_bound=sys.maxsize, allowed_types=('AnalysisService', ), relationship='CalculationAnalysisService', referenceClass=HoldingReference,