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, ), ), fields.Many2many(string='Partitions',
), 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 class Pricelist(models.Model, BaseOLiMSModel):
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'}, ), ), FixedPointField('AnalysisProfileVAT',
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', schemata='Accreditation', #write_permission = ManageBika,
# 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"), ), ),
), 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, widget = StringWidget(
# 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',), # relationship = 'ContactContact',
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', # default = ['ar', ],
), 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, # widget = ReferenceWidget(
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'
# 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'), # ), # ),
# 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( string='Manufacturer', comodel_name='olims.manufacturer',
'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 _name = 'olims.instrument_maintenance_task'
), # 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() # displayContentsTab = False
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"), ),