DateTimeField('DateApplied', widget = DateTimeWidget( label = _("Date Applied"), size=12, visible={'edit': 'visible', 'view': 'visible', 'add': 'visible', 'secondary': 'invisible'}, ), ), IntegerField('NumberSamples', widget = IntegerWidget( label = _("Number of samples"), ), ), BooleanField('Status', searchable = True, widget = StringWidget( label = _("Status"), ), ), # ~~~~~~~ To be implemented ~~~~~~~ # LinesField('Remarks', # widget = LinesWidget( # label = _("Remarks"), # ) # ), # ~~~~~~~ To be implemented ~~~~~~~ # LinesField('Analyses', # widget = LinesWidget( # label = _("Analyses"), # ) # ), # ~~~~~~~ To be implemented ~~~~~~~
string='Analysis', comodel_name='olims.analysis', required=True, # 'Analysis', # required=1, # allowed_types=('Analysis',), # referenceClass=HoldingReference, # relationship='DuplicateAnalysisAnalysis', ), # InterimFieldsField( # 'InterimFields', # ), StringField('Result', ), StringField('ResultDM', ), BooleanField('Retested', ), # ~~~~~~~ To be implemented ~~~~~~~ # fields.One2many(string='Attachment', # comodel_name='olims.analysis', # # multiValued=1, # # allowed_types=('Attachment',), # # referenceClass=HoldingReference, # # relationship='DuplicateAnalysisAttachment', # ), # ReferenceField( # 'Attachment', # multiValued=1, # allowed_types=('Attachment',), # referenceClass=HoldingReference, # relationship='DuplicateAnalysisAttachment',
StringField('ClientID', required=1, searchable = True, #validators = ('uniquefieldvalidator', 'standard_id_validator'), widget=StringWidget( label=_('Client ID'), description=_('ClientID is required.'), ), ), BooleanField('BulkDiscount', default = False, #write_permission = ManageClients, widget = BooleanWidget( label=_("Bulk discount applies"), ), ), BooleanField('MemberDiscountApplies', default = False, #write_permission = ManageClients, widget = BooleanWidget( label=_("Member discount applies"), ), ), # ~~~~~~~ To be implemented ~~~~~~~ # atapi.LinesField('EmailSubject', # schemata = 'Preferences',
# 'header_table': 'visible', # 'sample_registered': {'view': 'visible', 'edit': 'visible'}, # 'to_be_sampled': {'view': 'visible', 'edit': 'visible'}, # 'sampled': {'view': 'visible', 'edit': 'visible'}, # 'to_be_preserved': {'view': 'visible', 'edit': 'visible'}, # 'sample_due': {'view': 'visible', 'edit': 'visible'}, # 'sample_received': {'view': 'visible', 'edit': 'visible'}, # 'expired': {'view': 'visible', 'edit': 'visible'}, # 'disposed': {'view': 'visible', 'edit': 'invisible'}, # }, # catalog_name='bika_setup_catalog', # base_query={'inactive_state': 'active'}, # showOn=True, # ), # ), BooleanField('SamplingWorkflowEnabled', default_method='getSamplingWorkflowEnabledDefault'), DateTimeField( 'DateSampled', # mode="rw", # read_permission=permissions.View, # write_permission=SampleSample, # widget = DateTimeWidget( # label=_("Date Sampled"), # size=20, # visible={'edit': 'visible', # 'view': 'visible', # 'header_table': 'visible', # 'sample_registered': {'view': 'invisible', 'edit': 'invisible'}, # 'to_be_sampled': {'view': 'visible', 'edit': 'visible'}, # 'sampled': {'view': 'visible', 'edit': 'invisible'}, # 'to_be_preserved': {'view': 'visible', 'edit': 'invisible'},
string='Calculation', comodel_name='olims.calculation', required=False, ), fields.Many2many( string='InterimFields', comodel_name='olims.interimfield', ), StringField('Result', ), DateTimeField( 'ResultCaptureDate', widget=ComputedWidget(visible=False, ), ), StringField('ResultDM', ), BooleanField( 'Retested', default=False, ), fields.Char(string='Days'), fields.Char(string='Hours'), fields.Char(string='Minutes'), DateTimeField( 'DateAnalysisPublished', widget=DateTimeWidget(label=_("Date Published"), ), ), DateTimeField( 'DueDate', widget=DateTimeWidget(label=_("Due Date"), ), ), IntegerField('Duration', widget=IntegerWidget(label=_("Duration"), )), IntegerField('Earliness', widget=IntegerWidget(label=_("Earliness"), )), BooleanField(
searchable=1, required=0, schemata='Accounting', widget=StringWidget( visible={'view': 'visible', 'edit': 'visible'}, label=_('Commercial ID'), description=_("The profile's commercial ID for accounting purposes."), ), ), # When it's set, the system uses the analysis profile's price to quote and the system's VAT is overridden by the # the analysis profile's specific VAT BooleanField('UseAnalysisProfilePrice', default=False, schemata='Accounting', widget=BooleanWidget( label=_("Use Analysis Profile Price"), description=_("When it's set, the system uses the analysis profile's price to quote and the system's VAT is" " overridden by the analysis profile's specific VAT"), ) ), # The price will only be used if the checkbox "use analysis profiles' price" is set. # This price will be used to quote the analyses instead of analysis service's price. FixedPointField('AnalysisProfilePrice', schemata="Accounting", default='0.00', widget=DecimalWidget( label = _("Price (excluding VAT)"), visible={'view': 'visible', 'edit': 'visible'}, ), ),
comodel_name='olims.container', # allowed_types=('Container',), # relationship='SamplePartitionContainer', # required=1, # multiValued=0, ), fields.Many2one( string='Preservation', required=False, comodel_name='olims.preservation', # allowed_types=('Preservation',), # relationship='SamplePartitionPreservation', # required=0, # multiValued=0, ), BooleanField('Separate', default=False), fields.Many2one( string='Analyses', required=False, comodel_name='olims.analyses', # allowed_types=('Analyses',), # relationship='SamplePartitionAnalysis', # required=0, # multiValued=0, ), DateTimeField('DatePreserved', ), StringField('Preserver', searchable=True), fields.Char(string='Days'), fields.Char(string='Hours'), fields.Char(string='Minutes'), # ~~~~~~~ To be implemented ~~~~~~~
comodel_name='olims.reference_definition', # schemata = 'Description', # allowed_types = ('ReferenceDefinition',), # relationship = 'ReferenceSampleReferenceDefinition', # referenceClass = HoldingReference, # vocabulary = "getReferenceDefinitions", # widget = ReferenceWidget( # checkbox_bound = 0, # label=_("Reference Definition"), # ), ), BooleanField( 'Blank', schemata='Description', default=False, widget=BooleanWidget( label=_("Blank"), description=_("Reference sample values are zero or 'blank'"), ), ), BooleanField( 'Hazardous', schemata='Description', default=False, widget=BooleanWidget( label=_("Hazardous"), description=_( "Samples of this type should be treated as hazardous"), ), ), fields.Many2one(
# ~~~~~~~ To be implemented ~~~~~~~ # LinesField('_AvailableInstruments', # vocabulary='_getAvailableInstrumentsDisplayList', # widget=MultiSelectionWidget( # modes = ('edit'), # ) # ), # If no instrument selected, always True. Otherwise, the user will # be able to set or unset the value. The behavior for this field # is controlled with javascript. BooleanField( 'ManualEntryOfResults', default=False, widget=BooleanWidget( label=_("Manual entry of results"), description= _("The results for the Analysis Services that use this method can be set manually" ), modes=('edit'), )), # Only shown in readonly view. Not in edit view # ~~~~~~~ To be implemented ~~~~~~~ # ComputedField('ManualEntryOfResultsViewField', # expression = "context.isManualEntryOfResults()", # widget = BooleanWidget( # label=_("Manual entry of results"), # description=_("The results for the Analysis Services that use this method can be set manually"), # modes = ('view'), # ), # ),
# ), ), # ComputedField( # 'SampleTypeTitle', # expression="[o.Title() for o in context.getSampleTypes()]", # widget = ComputedWidget( # visibile=False, # ) # ), BooleanField( 'Composite', default=False, widget=BooleanWidget( label=_("Composite"), description= _("Check this box if the samples taken at this point are 'composite' " "and put together from more than one sub sample, e.g. several surface " "samples from a dam mixed together to be a representative sample for the dam. " "The default, unchecked, indicates 'grab' samples"), ), ), ) # schema['description'].widget.visible = True # schema['description'].schemata = 'default' class SamplePoint(models.Model, BaseOLiMSModel): #BaseContent, HistoryAwareMixin _name = 'olims.sample_point' # security = ClassSecurityInfo()
TextField( 'Remarks', default_content_type='text/plain', allowed_content_types=('text/plain', ), default_output_type="text/plain", widget=TextAreaWidget(label=_("Remarks"), ), ), FixedPointField( 'Cost', default='0.00', widget=DecimalWidget(label=_("Price"), ), ), BooleanField( 'Closed', default='0', widget=BooleanWidget( label=_("Closed"), description=_("Set the maintenance task as closed.")), ), ) class InstrumentMaintenanceTaskStatuses: CLOSED = 'Closed' CANCELLED = 'Cancelled' OVERDUE = "Overdue" PENDING = "Pending" INQUEUE = "In queue" class InstrumentMaintenanceTask(models.Model, BaseOLiMSModel): #BaseFolder
comodel_name='olims.sample', ), fields.Many2one( string='SampleType', comodel_name='olims.sample_type', readonly=True, ), fields.Many2one( string='SamplePoint', comodel_name='olims.sample_point', ), fields.Many2one( string='StorageLocation', comodel_name='olims.storage_location', ), BooleanField('SamplingWorkflowEnabled', default_method='getSamplingWorkflowEnabledDefault'), DateTimeField('DateSampled', ), StringField('Sampler', ), DateTimeField( 'SamplingDate', readonly=True, ), fields.Many2one( string='SamplingDeviation', comodel_name='olims.sampling_deviation', ), fields.Many2one( string='SampleCondition', comodel_name='olims.sample_condition', ), DateTimeField(
widget = StringWidget( label=_("Certificate Code"), ), ), fields.Many2one(string='Instrument', comodel_name='olims.instrument', required = False, ), # Set the Certificate as Internal # When selected, the 'Agency' field is hidden BooleanField('Internal', default=False, widget=BooleanWidget( label=_("Internal Certificate"), description=_("Select if is an in-house calibration certificate") ) ), StringField('Agency', widget = StringWidget( label=_("Agency"), description=_("Organization responsible of granting the calibration certificate") ), ), DateTimeField('Date', widget = DateTimeWidget( label=_("Date"), description=_("Date when the calibration certificate was granted"),
), StringField('ShortTitle', schemata="Description", widget=StringWidget( label = _("Short title"), description=_( "If text is entered here, it is used instead of the " + \ "title when the service is listed in column headings. " + \ "HTML formatting is allowed.") ), ), BooleanField('ScientificName', schemata="Description", default=False, widget=BooleanWidget( label = _("Scientific name"), description = _( "If enabled, the name of the analysis will be " + \ "written in italics."), ), ), StringField('Unit', schemata="Description", widget=StringWidget( label = _("Unit"), description=_( "The measurement units for this analysis service' results, " + \ "e.g. mg/l, ppm, dB, mV, etc."), ), ), IntegerField('Precision', schemata="Analysis",
help="Method", # vocabulary='_getAvailableMethods', # allowed_types=('Method',), # relationship='InstrumentMethod', # required=0, # widget=SelectionWidget( # format='select', # label=_("Method"), # ), ), BooleanField('DisposeUntilNextCalibrationTest', default = False, widget = BooleanWidget( label=_("De-activate until next calibration test"), description=_("If checked, the instrument will be unavailable until the next valid "+ "calibration was performed. This checkbox will automatically be unchecked."), ), ), # Procedures TextField('InlabCalibrationProcedure', schemata = 'Procedures', default_content_type = 'text/plain', allowed_content_types= ('text/plain', ), default_output_type="text/plain", widget = TextAreaWidget( label=_("In-lab calibration procedure"), description=_("Instructions for in-lab regular calibration routines intended for analysts"), ), ),
# ), ), StringField('Capacity', required = 1, default = "0 ml", widget = StringWidget( label=_("Capacity"), description=_("Maximum possible size or volume of samples."), ), ), BooleanField('PrePreserved', validators = ('container_prepreservation_validator'), default = False, widget = BooleanWidget( label=_("Pre-preserved"), description = _( "Check this box if this container is already preserved." + \ "Setting this will short-circuit the preservation workflow " + \ "for sample partitions stored in this container."), ), ), fields.Many2one(string='Preservation', required = False, comodel_name='olims.preservation', help="If this container is pre-preserved, then the preservation " +\ "method could be selected here." # vocabulary_display_path_bound = sys.maxint, # allowed_types = ('Preservation',), # vocabulary = 'getPreservations', # relationship = 'ContainerPreservation', # referenceClass = HoldingReference,
), TextField('Description', widget=TextAreaWidget( label=_('Description'), description=_('Used in item listings and search results.')), ), fields.Char(string='Days', required=False), fields.Char(string='Hours', required=False), fields.Char(string='Minutes', required=False), BooleanField('Hazardous', default = False, widget = BooleanWidget( label=_("Hazardous"), description=_("Samples of this type should be treated as hazardous"), ), ), fields.Many2one(string='Sample Matrix', comodel_name='olims.sample_matrix', required = False, ), StringField('Prefix', required = True, widget = StringWidget( label=_("Sample Type Prefix"), ), ), StringField('Minimum Volume', required = 1,
fields.Many2one( string='SamplingDeviation', comodel_name='olims.sampling_deviation', ), # # Sample field fields.Many2one( string='SampleCondition', comodel_name='olims.sample_condition', ), fields.Many2one( string='DefaultContainerType', comodel_name='olims.container_type', ), # Sample field BooleanField( 'AdHoc', default=False, ), # Sample field BooleanField( 'Composite', default=False, ), BooleanField( 'ReportDryMatter', default=False, ), BooleanField( 'InvoiceExclude', default=False, ), DateTimeField('DateReceived', ),
IntegerField( 'Confidence', default=100, schemata='Accreditation', widget=IntegerWidget( label=_("Confidence Level %"), description=_( "This value is reported at the bottom of all published results" ), ), ), BooleanField( 'LaboratoryAccredited', default=False, schemata='Accreditation', #write_permission = ManageBika, widget=BooleanWidget( label=_("Laboratory Accredited"), description=_("Check this box if your laboratory is accredited"), ), ), StringField( 'AccreditationBody', schemata='Accreditation', #write_permission = ManageBika, widget=StringWidget( label=_("Accreditation Body Abbreviation"), description=_("E.g. SANAS, APLAC, etc."), ), ), StringField( 'AccreditationBodyURL',
help='6x16 pixel icon used for the this priority in listings.', widget = FileWidget( label = _("Small Icon"), ), ), FileField('bigIcon', help='32x32 pixel icon used for the this priority in object views.', widget = FileWidget( label = _("Big Icon"), ), ), BooleanField('isDefault', widget=BooleanWidget( label = _("Default Priority?"), description = _("Check this box if this is the default priority"), ), ), StringField('ChangeNote', widget=StringWidget( label=_("Change Note"), description=_("Enter a comment that describes the changes you made") ), ), )#) # ~~~~~~~~~~ Irrelevant code for Odoo ~~~~~~~~~~~ # schema['description'].widget.visible = True class ARPriority(models.Model, BaseOLiMSModel):#(BaseContent): _name = 'olims.ar_priority'
fields.Many2one(string='Sample Point', comodel_name='olims.sample_point', help="Location where sample was taken", required=False, ), fields.Many2one(string='SampleType', comodel_name='olims.sample_type', help="Create a new sample of this type", required=False, ), BooleanField('ReportDryMatter', default = False, widget = BooleanWidget( label = _("Report as Dry Matter"), description = _("These results can be reported as dry matter"), ), ), TextField('Remarks', searchable = True, default_content_type = 'text/plain', allowed_content_types= ('text/plain', ), default_output_type="text/plain", widget = TextAreaWidget( macro = "bika_widgets/remarks", label = _("Remarks"), append_only = True, ), ),
# note line filed multi-select , multi-select need to be implemented fields.Selection(string='PublicationPreference', selection=([ ('email', _('Email')), ('pdf', _('PDF'))]), # widget = MultiSelectionWidget( # label=_("Publication preference"), # ), ), BooleanField('AttachmentsPermitted', default = False, schemata = 'Publication preference', widget = BooleanWidget( label=_("Results attachments permitted"), description = _( "File attachments to results, e.g. microscope "+ \ "photos, will be included in emails to recipients "+ \ "if this option is enabled") ), ), fields.Many2many(string='CCContact', comodel_name='olims.contact', relation='olims_contatct_cc_contatct', column1='contact_id', culomn2='contact_id', # schemata = 'Publication preference', # vocabulary = 'getContacts', # multiValued = 1, # allowed_types = ('Contact',),
), fields.Selection(string='BulkDiscount', selection=BULK_DISCOUNT_OPTION ), FixedPointField('BulkPrice', widget=DecimalWidget( label=_("Discount %"), description=_("Enter discount percentage value"), ), ), BooleanField('Descriptions', default=False, widget=BooleanWidget( label=_("Include descriptions"), description=_("Select if the descriptions should be included"), ), ), DateTimeField('ExpirationDate'), DateTimeField('EffectiveDate'), ) def apply_discount(price=None, discount=None): return float(price) - (float(price) * float(discount)) / 100 def get_vat_amount(price, vat_perc): return float(price) * float(vat_perc) / 100
schema = ( ReferenceField( string='Type', selection=([('olims.analysis_service', _('Analysis Services')), ('olims.lab_product', _('Lab Products'))]), required=0, # widget = ReferenceWidget( # checkbox_bound = 0, # # format='select', # # label=_("Pricelist for"), # ), ), BooleanField( 'BulkDiscount', default=False, #widget=SelectionWidget( # label=_("Bulk discount applies"), #), ), FixedPointField( 'BulkPrice', widget=DecimalWidget( label=_("Discount %"), description=_("Enter discount percentage value"), ), ), BooleanField( 'Descriptions', default=False, widget=BooleanWidget( label=_("Include descriptions"),