예제 #1
0
from openerp import fields, models
from base_olims_model import BaseOLiMSModel

schema = (
    StringField(
        'Template',
        required=1,
        widget=StringWidget(
            label=_('Title'),
            description=_('Title is required.'),
        ),
    ),
    TextField(
        'Description',
        widget=TextAreaWidget(
            label=_('Description'),
            description=_('Used in item listings and search results.'),
        ),
    ),
    fields.Many2one(string='Department',
                    comodel_name='olims.department',
                    help='The laboratory department',
                    required=True,
                    relation='srtemplate_department'),
    TextField(
        'Instructions',
        searchable=True,
        default_content_type='text/plain',
        allowed_content_types=('text/plain'),
        default_output_type="text/plain",
        widget=TextAreaWidget(
            label=_("Instructions"),
예제 #2
0
    ARTemplate includes all AR fields, including preset AnalysisProfile
"""
from openerp.tools.translate import _
from openerp import fields, models, api
from base_olims_model import BaseOLiMSModel
from fields.widget.widget import BooleanWidget, TextAreaWidget
from fields.boolean_field import BooleanField
from fields.string_field import StringField
from fields.text_field import TextField

schema = (StringField('Template',
              required=1,        
    ),
    TextField('Description',
        widget=TextAreaWidget(
            description = _('Used in item listings and search results.'),
                            )
    ),
    ## SamplePoint and SampleType references are managed with
    ## accessors and mutators below to get/set a string value
    ## (the Title of the object), but still store a normal Reference.
    ## Form autocomplete widgets can then work with the Titles.

    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',
예제 #3
0
    ),
    # # TODO Remove. Instruments must be assigned directly to each analysis.
    # ReferenceField('Instrument',
    #     required = 0,
    #     allowed_types = ('Instrument',),
    #     relationship = 'WorksheetInstrument',
    #     referenceClass = HoldingReference,
    # ),
    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,
        ),
    ),
)
# schema['id'].required = 0
# schema['id'].widget.visible = False
# schema['title'].required = 0
# schema['title'].widget.visible = {'edit': 'hidden', 'view': 'invisible'}


class Worksheet(models.Model, BaseOLiMSModel): #BaseFolder, HistoryAwareMixin
    _name ='olims.worksheet'
    # security = ClassSecurityInfo()
    # implements(IWorksheet)
    # displayContentsTab = False
예제 #4
0
파일: sampletype.py 프로젝트: nafwa03/olims
from dependencies.dependency import getToolByName
from dependencies.dependency import safe_unicode
from openerp.tools.translate import _
from openerp import fields, models
from fields.string_field import StringField
from fields.text_field import TextField
from fields.boolean_field import BooleanField
from fields.widget.widget import TextAreaWidget, BooleanWidget, StringWidget
from base_olims_model import BaseOLiMSModel
from lims.utils import t
schema = (StringField('SampleType',
              required=1,        
    ),
    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"),
        ),
    ),
예제 #5
0
from dependencies.dependency import WorkflowException
from fields.string_field import StringField
from fields.text_field import TextField
from fields.widget.widget import TextAreaWidget
from base_olims_model import BaseOLiMSModel
import sys
from dependencies import transaction

# ~~~~~~~~~~ Irrelevant code for Odoo ~~~~~~~~~~~
# schema = BikaSchema.copy() + Schema(
schema =  (StringField('name',
              required=1,        
    ),
    TextField('Description',
        widget=TextAreaWidget(
            description = _('Used in item listings and search results.'),
                            )
    ),
    TextField('Comments',
        default_output_type = 'text/plain',
        allowable_content_types = ('text/plain',),
        widget=TextAreaWidget (
            description = _("To be displayed below each Analysis "
                            "Category section on results reports."),
            label = _("Comments")),
    ),
# ~~~~~~~ Using Odoo fields.Reference ~~~~~~~
    fields.Many2one(string='Department',
        comodel_name='olims.department',
        required=False,
        help='The laboratory department'
예제 #6
0
import logging
_logger = logging.getLogger(__name__)

#schema = BikaFolderSchema.copy() + BikaSchema.copy() + Schema((
schema = (

    StringField('name',
        required=1,
        widget=StringWidget(
            label=_('Title'),
            description=_('Title is required.'),
        ),
    ),
    TextField('Description',
        widget=TextAreaWidget(
            label=_('Description'),
            description=_('Used in item listings and search results.'),
        ),
    ),

    fields.Many2one(string='InstrumentType',
           comodel_name='olims.instrument_type',
           required=True,

      #     vocabulary='getInstrumentTypes',
       # allowed_types=('InstrumentType',),
       # relationship='InstrumentInstrumentType',
        #required=1,
        # widget=SelectionWidget(
        #     format='select',
        #     label=_("Instrument type"),
        #     visible={'view': 'invisible', 'edit': 'visible'}
예제 #7
0
from openerp import fields, models, api
from base_olims_model import BaseOLiMSModel
from fields.string_field import StringField
from fields.text_field import TextField
from fields.widget.widget import TextAreaWidget

schema = (
    StringField(
        'Sampling Deviation',
        required=1,
    ),
    TextField(
        'Description',
        widget=TextAreaWidget(
            description=('Used in item listings and search results.'), )),
)


class SamplingDeviation(models.Model, BaseOLiMSModel):
    _name = 'olims.sampling_deviation'
    _rec_name = 'Sampling Deviation'

    _at_rename_after_creation = True

    def _renameAfterCreation(self, check_auto_id=False):
        from lims.idserver import renameAfterCreation
        renameAfterCreation(self)


SamplingDeviation.initialze(schema)
예제 #8
0
         description=_("Date until the instrument will not be available"),
     ),
 ),
 StringField('Calibrator',
             widget=StringWidget(
                 label=_("Calibrator"),
                 description=_(
                     "The analyst or agent responsible of the calibration"),
             )),
 TextField(
     'Considerations',
     default_content_type='text/plain',
     allowed_content_types=('text/plain', ),
     default_output_type="text/plain",
     widget=TextAreaWidget(
         label=_("Considerations"),
         description=_("Remarks to take into account before calibration"),
     ),
 ),
 TextField(
     'WorkPerformed',
     #   default_content_type = 'text/plain',
     #   allowed_content_types= ('text/plain', ),
     #   default_output_type="text/plain",
     widget=TextAreaWidget(
         label=_("Work Performed"),
         description=_(
             "Description of the actions made during the calibration"),
     ),
 ),
 fields.Many2one(
     string='Worker',
예제 #9
0
     'StartDate',
     required=1,
     default_method='current_date',
     widget=DateTimeWidget(label=_("Date"), ),
 ),
 DateTimeField(
     'EndDate',
     required=1,
     default_method='end_date',
     widget=DateTimeWidget(label=_("End Date"), ),
 ),
 TextField(
     'Remarks',
     searchable=True,
     widget=TextAreaWidget(
         label=_("Remarks"),
         append_only=True,
     ),
 ),
 fields.Float(string='Subtotal', compute='_getSubtotal'),
 fields.Float(
     string='VAT',
     compute='_getVATAmount',
 ),
 fields.Float(
     'Total',
     compute='_getTotal',
 ),
 fields.Many2one(
     string='Order_id',
     comodel_name='olims.supply_order',
 ),
예제 #10
0
# ~~~~~~~~~~ Irrelevant code for Odoo ~~~~~~~~~~~
# schema = BikaSchema.copy() + Schema(
schema = (
    StringField(
        'name',
        required=True,
        widget=StringWidget(
            label=_('Title'),
            description=_('Title is required.'),
        ),
    ),
    TextField(
        'Description',
        widget=TextAreaWidget(
            label=_('Description'),
            description=_('Used in item listings and search results.'),
        ),
    ),
    # Method ID should be unique, specified on MethodSchemaModifier
    StringField(
        'MethodID',
        searchable=1,
        required=0,
        help='Define an identifier code for the method. It must be unique.',
        validators=('uniquefieldvalidator', ),
        widget=StringWidget(
            visible={
                'view': 'visible',
                'edit': 'visible'
            },
            label=_('Method ID'),
     ),
 ),
 StringField('Maintainer',
             widget=StringWidget(
                 label=_("Maintainer"),
                 description=_(
                     "The analyst or agent responsible of the maintenance"),
             )),
 TextField(
     'Considerations',
     default_content_type='text/plain',
     allowed_content_types=('text/plain', ),
     default_output_type="text/plain",
     widget=TextAreaWidget(
         label=_("Considerations"),
         description=_(
             "Remarks to take into account for maintenance process"),
     ),
 ),
 TextField(
     'WorkPerformed',
     default_content_type='text/plain',
     allowed_content_types=('text/plain', ),
     default_output_type="text/plain",
     widget=TextAreaWidget(
         label=_("Work Performed"),
         description=_(
             "Description of the actions made during the maintenance process"
         ),
     ),
 ),
예제 #12
0
    fields.Many2one(
        string='Instrument',
        comodel_name='olims.instrument',
    ),
    StringField(
        'Type',
        vocabulary="getTaskTypes",
        widget=ReferenceWidget(
            checkbox_bound=0,
            label=("Task type", "Type"),
        ),
    ),
    TextField(
        'Considerations',
        default_content_type='text/plain',
        allowed_content_types=('text/plain', ),
        default_output_type="text/plain",
        widget=TextAreaWidget(
            label=_("Considerations"),
            description=_(
                "Remarks to take into account before performing the task"),
        ),
    ),
)


class InstrumentScheduledTask(models.Model, BaseOLiMSModel):  #BaseFolder
    _name = 'olims.instrument_scheduled_task'


InstrumentScheduledTask.initialze(schema)
예제 #13
0
        ),
    ),
    TextField(
        'Formula',
        schemata='Calculation',
        validators=('formulavalidator', ),
        default_content_type='text/plain',
        allowable_content_types=('text/plain', ),
        widget=TextAreaWidget(
            label=_("Calculation Formula"),
            description=_(
                "calculation_formula_description",
                "<p>The formula you type here will be dynamically calculated "
                "when an analysis using this calculation is displayed.</p>"
                "<p>To enter a Calculation, use standard maths operators,  "
                "+ - * / ( ), and all keywords available, both from other "
                "Analysis Services and the Interim Fields specified here, "
                "as variables. Enclose them in square brackets [ ].</p>"
                "<p>E.g, the calculation for Total Hardness, the total of "
                "Calcium (ppm) and Magnesium (ppm) ions in water, is entered "
                "as [Ca] + [Mg], where Ca and MG are the keywords for those "
                "two Analysis Services.</p>"),
        )),
)  #)
# ~~~~~~~~~~ Irrelevant code for Odoo ~~~~~~~~~~~
# schema['title'].widget.visible = True
# schema['title'].schemata = 'Description'
# schema['description'].widget.visible = True
# schema['description'].schemata = 'Description'

예제 #14
0
from lims import bikaMessageFactory as _
from fields.text_field import TextField
from fields.widget.widget import TextAreaWidget
from openerp import fields, models
from models.base_olims_model import BaseOLiMSModel

#schema = BikaSchema.copy() + Schema((
schema = (
    TextField(
        'Instructions',
        searchable=True,
        default_content_type='text/plain',
        allowed_content_types=('text/plain'),
        default_output_type="text/plain",
        widget=TextAreaWidget(
            label=_("Instructions"),
            append_only=True,
        ),
    ),
    fields.Many2one(
        string='ARTemplates',
        comodel_name='olims.ar_template',
        required=True,
        help='Select AR Templates to include'
        # schemata = 'AR Templates',
        # required = 1,
        # multiValued = 1,
        # allowed_types = ('ARTemplate',),
        # relationship = 'SRTemplateARTemplate',
        # widget = ReferenceWidget(
        #     label=_("AR Templates"),
        #     description=_("Select AR Templates to include"),