Code Duplication    Length = 26-29 lines in 2 locations

src/bika/lims/browser/instrument.py 1 location

@@ 535-563 (lines=29) @@
532
    and duplicate analyses linked to this instrument are not displayed.
533
    """
534
535
    def __init__(self, context, request, **kwargs):
536
        AnalysesView.__init__(self, context, request, **kwargs)
537
538
        self.form_id = "{}_qcanalyses".format(api.get_uid(context))
539
        self.allow_edit = True
540
        self.show_select_column = True
541
        self.show_search = False
542
543
        self.catalog = ANALYSIS_CATALOG
544
545
        self.contentFilter = {
546
            "portal_type": "ReferenceAnalysis",
547
            "getInstrumentUID": api.get_uid(self.context),
548
            "sort_on": "getResultCaptureDate",
549
            "sort_order": "reverse"
550
        }
551
552
        # insert the QC-specific columns
553
        self.add_column("getReferenceAnalysesGroupID",
554
                        title=_("QC Sample ID"),
555
                        after="Service")
556
557
        self.add_column("Partition",
558
                        title=_("Reference Sample"),
559
                        after="getReferenceAnalysesGroupID")
560
561
        self.add_column("Retractions", title=_("Retractions"))
562
563
        self.chart = EvolutionChart()
564
565
    def add_column(self, id, **kwargs):
566
        """Add the given column to all review states

src/bika/lims/browser/referencesample.py 1 location

@@ 120-145 (lines=26) @@
117
    """Reference Analyses on this sample
118
    """
119
120
    def __init__(self, context, request):
121
        super(ReferenceAnalysesView, self).__init__(context, request)
122
123
        self.form_id = "{}_qcanalyses".format(api.get_uid(context))
124
        self.allow_edit = True
125
        self.show_select_column = True
126
        self.show_search = False
127
128
        self.contentFilter = {
129
            "portal_type": "ReferenceAnalysis",
130
            "path": {
131
                "query": "/".join(self.context.getPhysicalPath()),
132
                "level": 0},
133
            "sort_on": "getResultCaptureDate",
134
            "sort_order": "descending"
135
        }
136
137
        # insert the QC-specific columns
138
        self.add_column("getReferenceAnalysesGroupID",
139
                        title=_("QC Analysis ID"),
140
                        after="Service")
141
        self.add_column("Worksheet",
142
                        title=_("Worksheet"),
143
                        after="getReferenceAnalysesGroupID")
144
145
        self.chart = EvolutionChart()
146
147
    def add_column(self, id, **kwargs):
148
        """Add the given column to all review states