Passed
Push — 2.x ( 5e1af5...1a3808 )
by Ramon
05:55
created

bika.lims.content.samplecondition.SampleConditions()   A

Complexity

Conditions 2

Size

Total Lines 10
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 10
rs 9.9
c 0
b 0
f 0
cc 2
nop 3
1
# -*- coding: utf-8 -*-
2
#
3
# This file is part of SENAITE.CORE.
4
#
5
# SENAITE.CORE is free software: you can redistribute it and/or modify it under
6
# the terms of the GNU General Public License as published by the Free Software
7
# Foundation, version 2.
8
#
9
# This program is distributed in the hope that it will be useful, but WITHOUT
10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
# details.
13
#
14
# You should have received a copy of the GNU General Public License along with
15
# this program; if not, write to the Free Software Foundation, Inc., 51
16
# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
#
18
# Copyright 2018-2024 by it's authors.
19
# Some rights reserved, see README and LICENSE.
20
21
from AccessControl.SecurityInfo import ClassSecurityInfo
22
from bika.lims.config import PROJECTNAME
23
from bika.lims.content.bikaschema import BikaSchema
24
from bika.lims.interfaces import IDeactivable
25
from Products.Archetypes.public import BaseFolder
26
from Products.Archetypes.public import registerType
27
from Products.Archetypes.public import Schema
28
from zope.interface import implements
29
30
schema = BikaSchema.copy() + Schema((
31
32
))
33
34
schema['description'].schemata = 'default'
35
schema['description'].widget.visible = True
36
37
38
# TODO: Migrated to DX - https://github.com/senaite/senaite.core/pull/2478
39
class SampleCondition(BaseFolder):
40
    implements(IDeactivable)
41
    security = ClassSecurityInfo()
42
    displayContentsTab = False
43
    schema = schema
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable schema does not seem to be defined.
Loading history...
44
45
    _at_rename_after_creation = True
46
47
    def _renameAfterCreation(self, check_auto_id=False):
48
        from senaite.core.idserver import renameAfterCreation
49
        renameAfterCreation(self)
50
51
52
registerType(SampleCondition, PROJECTNAME)
53