cleans super() method calls
This commit is contained in:
parent
186e1b7b5b
commit
61696336f4
|
@ -110,7 +110,7 @@ class Typification(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Typification, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('product_type', 'ASC'))
|
||||
cls._order.insert(1, ('matrix', 'ASC'))
|
||||
cls._order.insert(2, ('analysis', 'ASC'))
|
||||
|
@ -280,7 +280,7 @@ class Typification(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def validate(cls, typifications):
|
||||
super(Typification, cls).validate(typifications)
|
||||
super().validate(typifications)
|
||||
for t in typifications:
|
||||
t.check_limits()
|
||||
t.check_default()
|
||||
|
@ -325,7 +325,7 @@ class Typification(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def create(cls, vlist):
|
||||
typifications = super(Typification, cls).create(vlist)
|
||||
typifications = super().create(vlist)
|
||||
active_typifications = [t for t in typifications if t.valid]
|
||||
cls.create_typification_calculated(active_typifications)
|
||||
return typifications
|
||||
|
@ -389,7 +389,7 @@ class Typification(ModelSQL, ModelView):
|
|||
@classmethod
|
||||
def delete(cls, typifications):
|
||||
cls.delete_typification_calculated(typifications)
|
||||
super(Typification, cls).delete(typifications)
|
||||
super().delete(typifications)
|
||||
|
||||
@classmethod
|
||||
def delete_typification_calculated(cls, typifications):
|
||||
|
@ -422,7 +422,7 @@ class Typification(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def write(cls, *args):
|
||||
super(Typification, cls).write(*args)
|
||||
super().write(*args)
|
||||
actions = iter(args)
|
||||
for typifications, vals in zip(actions, actions):
|
||||
if 'valid' in vals:
|
||||
|
@ -518,7 +518,7 @@ class TypificationReadOnly(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(TypificationReadOnly, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('product_type', 'ASC'))
|
||||
cls._order.insert(1, ('matrix', 'ASC'))
|
||||
cls._order.insert(2, ('analysis', 'ASC'))
|
||||
|
@ -557,7 +557,7 @@ class CalculatedTypification(ModelSQL):
|
|||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
super(CalculatedTypification, cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
if cls.search_count([]) == 0:
|
||||
cls.populate_typification_calculated()
|
||||
|
||||
|
@ -637,7 +637,7 @@ class CalculatedTypificationReadOnly(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(CalculatedTypificationReadOnly, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('product_type', 'ASC'))
|
||||
cls._order.insert(1, ('matrix', 'ASC'))
|
||||
cls._order.insert(2, ('analysis', 'ASC'))
|
||||
|
@ -673,7 +673,7 @@ class ProductType(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ProductType, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('code_uniq', Unique(t, t.code),
|
||||
|
@ -713,7 +713,7 @@ class Matrix(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Matrix, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('code_uniq', Unique(t, t.code),
|
||||
|
@ -757,7 +757,7 @@ class ObjectiveDescription(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ObjectiveDescription, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('product_type', 'ASC'))
|
||||
cls._order.insert(1, ('matrix', 'ASC'))
|
||||
cls._order.insert(2, ('description', 'ASC'))
|
||||
|
@ -934,7 +934,7 @@ class Analysis(Workflow, ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Analysis, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('code_uniq', Unique(t, t.code),
|
||||
|
@ -1116,7 +1116,7 @@ class Analysis(Workflow, ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def validate(cls, analysis):
|
||||
super(Analysis, cls).validate(analysis)
|
||||
super().validate(analysis)
|
||||
for a in analysis:
|
||||
cls.check_duplicate_description(a.type, a.description)
|
||||
a.check_set()
|
||||
|
@ -1165,7 +1165,7 @@ class Analysis(Workflow, ModelSQL, ModelView):
|
|||
for a in analysis:
|
||||
cls.check_duplicate_description(vals.get('type', a.type),
|
||||
vals['description'], 0)
|
||||
super(Analysis, cls).write(*args)
|
||||
super().write(*args)
|
||||
|
||||
@classmethod
|
||||
def check_laboratory_change(cls, analysis, laboratories):
|
||||
|
@ -1407,7 +1407,7 @@ class Analysis(Workflow, ModelSQL, ModelView):
|
|||
current_default['state'] = 'draft'
|
||||
current_default['start_date'] = None
|
||||
current_default['end_date'] = None
|
||||
return super(Analysis, cls).copy(analysis, default=current_default)
|
||||
return super().copy(analysis, default=current_default)
|
||||
|
||||
@classmethod
|
||||
def get_pending_fractions(cls, records, name):
|
||||
|
@ -1596,7 +1596,7 @@ class AnalysisIncluded(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def validate(cls, included_analysis):
|
||||
super(AnalysisIncluded, cls).validate(included_analysis)
|
||||
super().validate(included_analysis)
|
||||
for analysis in included_analysis:
|
||||
analysis.check_duplicated_analysis()
|
||||
|
||||
|
@ -1744,7 +1744,7 @@ class AnalysisIncluded(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def create(cls, vlist):
|
||||
included_analysis = super(AnalysisIncluded, cls).create(vlist)
|
||||
included_analysis = super().create(vlist)
|
||||
cls.create_typification_calculated(included_analysis)
|
||||
return included_analysis
|
||||
|
||||
|
@ -1843,7 +1843,7 @@ class AnalysisIncluded(ModelSQL, ModelView):
|
|||
@classmethod
|
||||
def delete(cls, included_analysis):
|
||||
cls.delete_typification_calculated(included_analysis)
|
||||
super(AnalysisIncluded, cls).delete(included_analysis)
|
||||
super().delete(included_analysis)
|
||||
|
||||
@classmethod
|
||||
def delete_typification_calculated(cls, included_analysis):
|
||||
|
@ -1979,7 +1979,7 @@ class AnalysisLabMethod(ModelSQL):
|
|||
@classmethod
|
||||
def delete(cls, methods):
|
||||
cls.check_delete(methods)
|
||||
super(AnalysisLabMethod, cls).delete(methods)
|
||||
super().delete(methods)
|
||||
|
||||
@classmethod
|
||||
def check_delete(cls, methods):
|
||||
|
@ -2016,7 +2016,7 @@ class AnalysisDevice(DeactivableMixin, ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def validate(cls, devices):
|
||||
super(AnalysisDevice, cls).validate(devices)
|
||||
super().validate(devices)
|
||||
for d in devices:
|
||||
d.check_default()
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ class TechnicalScopeVersion(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(TechnicalScopeVersion, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._buttons.update({
|
||||
'open_typifications': {},
|
||||
'add_typifications': {
|
||||
|
@ -94,7 +94,7 @@ class TechnicalScopeVersion(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def validate(cls, versions):
|
||||
super(TechnicalScopeVersion, cls).validate(versions)
|
||||
super().validate(versions)
|
||||
for version in versions:
|
||||
version.check_active()
|
||||
|
||||
|
@ -148,7 +148,7 @@ class AnalysisFamily(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(AnalysisFamily, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('code_uniq', Unique(t, t.code),
|
||||
|
@ -184,7 +184,7 @@ class AnalysisFamilyCertificant(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(AnalysisFamilyCertificant, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('product_matrix_uniq',
|
||||
|
|
|
@ -55,7 +55,7 @@ class NotebookViewColumn(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(NotebookViewColumn, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('sequence', 'ASC'))
|
||||
|
||||
|
||||
|
@ -79,7 +79,7 @@ class User(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(User, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._context_fields.insert(0, 'laboratory')
|
||||
cls._context_fields.insert(0, 'laboratories')
|
||||
|
||||
|
@ -91,7 +91,7 @@ class User(metaclass=PoolMeta):
|
|||
RoleGroup = pool.get('res.role-res.group')
|
||||
UserRole = pool.get('res.user.role')
|
||||
|
||||
super(User, cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
|
||||
user_sql_table = cls.__table__()
|
||||
user_table = cls.__table_handler__(module_name)
|
||||
|
@ -234,7 +234,7 @@ class Configuration(ModelSingleton, ModelSQL, ModelView,
|
|||
pool = Pool()
|
||||
if field == 'planification_sequence':
|
||||
return pool.get('lims.configuration.sequence')
|
||||
return super(Configuration, cls).multivalue_model(field)
|
||||
return super().multivalue_model(field)
|
||||
|
||||
@classmethod
|
||||
def default_planification_sequence(cls, **pattern):
|
||||
|
@ -369,7 +369,7 @@ class LabWorkYear(ModelSQL, ModelView, CompanyMultiValueMixin):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(LabWorkYear, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('start_date', 'ASC'))
|
||||
|
||||
@classmethod
|
||||
|
@ -377,7 +377,7 @@ class LabWorkYear(ModelSQL, ModelView, CompanyMultiValueMixin):
|
|||
pool = Pool()
|
||||
if field in sequence_names:
|
||||
return pool.get('lims.lab.workyear.sequence')
|
||||
return super(LabWorkYear, cls).multivalue_model(field)
|
||||
return super().multivalue_model(field)
|
||||
|
||||
@classmethod
|
||||
def default_entry_sequence(cls, **pattern):
|
||||
|
@ -400,7 +400,7 @@ class LabWorkYear(ModelSQL, ModelView, CompanyMultiValueMixin):
|
|||
|
||||
@classmethod
|
||||
def validate(cls, years):
|
||||
super(LabWorkYear, cls).validate(years)
|
||||
super().validate(years)
|
||||
for year in years:
|
||||
year.check_dates()
|
||||
|
||||
|
@ -535,7 +535,7 @@ class LabWorkYearHoliday(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(LabWorkYearHoliday, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('date', 'ASC'))
|
||||
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ class RangeType(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def validate(cls, range_types):
|
||||
super(RangeType, cls).validate(range_types)
|
||||
super().validate(range_types)
|
||||
for rt in range_types:
|
||||
rt.check_default()
|
||||
|
||||
|
@ -191,7 +191,7 @@ class ControlTendency(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ControlTendency, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('rule_4_count', 'DESC'))
|
||||
cls._order.insert(1, ('rule_3_count', 'DESC'))
|
||||
cls._order.insert(2, ('rule_2_count', 'DESC'))
|
||||
|
@ -345,7 +345,7 @@ class ControlTendencyDetail(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ControlTendencyDetail, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('date', 'ASC'))
|
||||
cls._order.insert(1, ('fraction', 'ASC'))
|
||||
cls._order.insert(2, ('device', 'ASC'))
|
||||
|
@ -513,14 +513,13 @@ class ControlResultLine(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
super(ControlResultLine,
|
||||
cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
cursor = Transaction().connection.cursor()
|
||||
cursor.execute('DELETE FROM "' + cls._table + '"')
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ControlResultLine, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('product_type', 'ASC'))
|
||||
cls._order.insert(1, ('matrix', 'ASC'))
|
||||
cls._order.insert(2, ('analysis', 'ASC'))
|
||||
|
@ -580,7 +579,7 @@ class ControlResultLineDetail(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ControlResultLineDetail, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('date', 'ASC'))
|
||||
cls._order.insert(1, ('fraction', 'ASC'))
|
||||
cls._order.insert(2, ('device', 'ASC'))
|
||||
|
@ -1220,8 +1219,7 @@ class ControlChartReport(Report):
|
|||
|
||||
@classmethod
|
||||
def get_context(cls, reports, data):
|
||||
report_context = super(ControlChartReport, cls).get_context(
|
||||
reports, data)
|
||||
report_context = super().get_context(reports, data)
|
||||
pool = Pool()
|
||||
Company = pool.get('company.company')
|
||||
ControlTendency = pool.get('lims.control.tendency')
|
||||
|
@ -1362,7 +1360,7 @@ class TrendChart(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def validate(cls, charts):
|
||||
super(TrendChart, cls).validate(charts)
|
||||
super().validate(charts)
|
||||
for chart in charts:
|
||||
chart.check_analysis_qty()
|
||||
chart.check_uom()
|
||||
|
@ -1579,7 +1577,7 @@ class TrendChartAnalysis(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(TrendChartAnalysis, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('order', 'ASC'))
|
||||
|
||||
|
||||
|
@ -1594,7 +1592,7 @@ class TrendChartAnalysis2(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(TrendChartAnalysis2, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('order', 'ASC'))
|
||||
|
||||
|
||||
|
@ -1739,7 +1737,7 @@ class TrendChartData(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(TrendChartData, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls.__rpc__['fields_view_get'].cache = None
|
||||
|
||||
@classmethod
|
||||
|
@ -1798,8 +1796,7 @@ class TrendChartReport(Report):
|
|||
def get_context(cls, reports, data):
|
||||
TrendChart = Pool().get('lims.trend.chart')
|
||||
|
||||
report_context = super(TrendChartReport, cls).get_context(
|
||||
reports, data)
|
||||
report_context = super().get_context(reports, data)
|
||||
|
||||
chart_id = data.get('chart_id')
|
||||
chart = TrendChart(chart_id)
|
||||
|
|
|
@ -35,7 +35,7 @@ class UserDepartment(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def validate(cls, user_departments):
|
||||
super(UserDepartment, cls).validate(user_departments)
|
||||
super().validate(user_departments)
|
||||
for ud in user_departments:
|
||||
ud.check_default()
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ class Entry(Workflow, ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Entry, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('number', 'DESC'))
|
||||
cls._transitions |= set((
|
||||
('draft', 'ongoing'),
|
||||
|
@ -379,7 +379,7 @@ class Entry(Workflow, ModelSQL, ModelView):
|
|||
vlist = [x.copy() for x in vlist]
|
||||
for values in vlist:
|
||||
values['number'] = Sequence.get_id(sequence.id)
|
||||
return super(Entry, cls).create(vlist)
|
||||
return super().create(vlist)
|
||||
|
||||
@classmethod
|
||||
def copy(cls, entries, default=None):
|
||||
|
@ -395,7 +395,7 @@ class Entry(Workflow, ModelSQL, ModelView):
|
|||
current_default['sent_date'] = None
|
||||
current_default['result_cron'] = ''
|
||||
|
||||
new_entry, = super(Entry, cls).copy([entry],
|
||||
new_entry, = super().copy([entry],
|
||||
default=current_default)
|
||||
new_entries.append(new_entry)
|
||||
return new_entries
|
||||
|
@ -617,7 +617,7 @@ class Entry(Workflow, ModelSQL, ModelView):
|
|||
@classmethod
|
||||
def delete(cls, entries):
|
||||
cls.check_delete(entries)
|
||||
super(Entry, cls).delete(entries)
|
||||
super().delete(entries)
|
||||
|
||||
def get_confirmed(self, name=None):
|
||||
if not self.samples:
|
||||
|
@ -697,7 +697,7 @@ class EntrySuspensionReason(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(EntrySuspensionReason, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('code_uniq', Unique(t, t.code),
|
||||
|
@ -727,7 +727,7 @@ class EntrySuspensionReason(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def validate(cls, reasons):
|
||||
super(EntrySuspensionReason, cls).validate(reasons)
|
||||
super().validate(reasons)
|
||||
for sr in reasons:
|
||||
sr.check_default()
|
||||
|
||||
|
@ -805,7 +805,7 @@ class EntryDetailAnalysis(ModelSQL, ModelView):
|
|||
def __register__(cls, module_name):
|
||||
table_h = cls.__table_handler__(module_name)
|
||||
plannable_exist = table_h.column_exist('plannable')
|
||||
super(EntryDetailAnalysis, cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
if not plannable_exist:
|
||||
cursor = Transaction().connection.cursor()
|
||||
pool = Pool()
|
||||
|
@ -823,7 +823,7 @@ class EntryDetailAnalysis(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(EntryDetailAnalysis, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('service', 'DESC'))
|
||||
|
||||
@staticmethod
|
||||
|
@ -868,7 +868,7 @@ class EntryDetailAnalysis(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def view_attributes(cls):
|
||||
return super(EntryDetailAnalysis, cls).view_attributes() + [
|
||||
return super().view_attributes() + [
|
||||
('//group[@id="cie"]', 'states', {
|
||||
'invisible': ~Eval('cie_fraction_type'),
|
||||
})]
|
||||
|
@ -878,7 +878,7 @@ class EntryDetailAnalysis(ModelSQL, ModelView):
|
|||
vlist = [x.copy() for x in vlist]
|
||||
for values in vlist:
|
||||
values['plannable'] = cls._get_plannable(values)
|
||||
details = super(EntryDetailAnalysis, cls).create(vlist)
|
||||
details = super().create(vlist)
|
||||
cls._set_referable(details)
|
||||
return details
|
||||
|
||||
|
@ -888,7 +888,7 @@ class EntryDetailAnalysis(ModelSQL, ModelView):
|
|||
default = {}
|
||||
current_default = default.copy()
|
||||
current_default['confirmation_date'] = None
|
||||
return super(EntryDetailAnalysis, cls).copy(details,
|
||||
return super().copy(details,
|
||||
default=current_default)
|
||||
|
||||
@classmethod
|
||||
|
@ -901,7 +901,7 @@ class EntryDetailAnalysis(ModelSQL, ModelView):
|
|||
def delete(cls, details):
|
||||
if Transaction().user != 0:
|
||||
cls.check_delete(details)
|
||||
super(EntryDetailAnalysis, cls).delete(details)
|
||||
super().delete(details)
|
||||
|
||||
@classmethod
|
||||
def create_notebook_lines(cls, details, fraction):
|
||||
|
@ -1133,7 +1133,7 @@ class EntryDetailAnalysis(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def write(cls, *args):
|
||||
super(EntryDetailAnalysis, cls).write(*args)
|
||||
super().write(*args)
|
||||
actions = iter(args)
|
||||
for details, vals in zip(actions, actions):
|
||||
change_cie_data = False
|
||||
|
@ -1447,14 +1447,14 @@ class AcknowledgmentOfReceipt(Report):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(AcknowledgmentOfReceipt, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls.__rpc__['execute'] = RPC(False)
|
||||
|
||||
@classmethod
|
||||
def execute(cls, ids, data):
|
||||
Entry = Pool().get('lims.entry')
|
||||
|
||||
result = super(AcknowledgmentOfReceipt, cls).execute(ids, data)
|
||||
result = super().execute(ids, data)
|
||||
entry = Entry(ids[0])
|
||||
|
||||
if entry.ack_report_cache:
|
||||
|
@ -1472,8 +1472,7 @@ class AcknowledgmentOfReceipt(Report):
|
|||
Service = pool.get('lims.service')
|
||||
Entry = pool.get('lims.entry')
|
||||
|
||||
report_context = super(AcknowledgmentOfReceipt, cls).get_context(
|
||||
records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
if 'id' in data:
|
||||
entry = Entry(data['id'])
|
||||
else:
|
||||
|
@ -1661,11 +1660,11 @@ class EntryDetail(Report):
|
|||
def execute(cls, ids, data):
|
||||
if 'ids' in data:
|
||||
ids = data['ids']
|
||||
return super(EntryDetail, cls).execute(ids, data)
|
||||
return super().execute(ids, data)
|
||||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
report_context = super(EntryDetail, cls).get_context(records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
Company = Pool().get('company.company')
|
||||
|
||||
company = Company(Transaction().context.get('company'))
|
||||
|
@ -1680,7 +1679,7 @@ class EntryLabels(Report):
|
|||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
report_context = super(EntryLabels, cls).get_context(records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
labels = []
|
||||
for entry in records:
|
||||
for sample in entry.samples:
|
||||
|
|
|
@ -26,7 +26,7 @@ class FormulaParser(Model):
|
|||
raise UserError(gettext(
|
||||
'lims.msg_variable_redefine', variable=var))
|
||||
self._vars[var] = vars[var]
|
||||
super(FormulaParser, self).__init__(id, **kwargs)
|
||||
super().__init__(id, **kwargs)
|
||||
|
||||
def getValue(self):
|
||||
value = self.parseExpression()
|
||||
|
|
|
@ -48,7 +48,7 @@ class Laboratory(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Laboratory, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('code_uniq', Unique(t, t.code),
|
||||
|
@ -103,7 +103,7 @@ class LaboratoryProfessional(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(LaboratoryProfessional, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('code_uniq', Unique(t, t.code),
|
||||
|
@ -162,7 +162,7 @@ class LabMethod(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(LabMethod, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('code_uniq', Unique(t, t.code),
|
||||
|
@ -188,7 +188,7 @@ class LabMethod(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def write(cls, *args):
|
||||
super(LabMethod, cls).write(*args)
|
||||
super().write(*args)
|
||||
actions = iter(args)
|
||||
for methods, vals in zip(actions, actions):
|
||||
if 'results_estimated_waiting' in vals:
|
||||
|
@ -227,7 +227,7 @@ class LabMethodWaitingTime(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(LabMethodWaitingTime, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('method_party_uniq', Unique(t, t.method, t.party),
|
||||
|
@ -236,13 +236,13 @@ class LabMethodWaitingTime(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def create(cls, vlist):
|
||||
waiting_times = super(LabMethodWaitingTime, cls).create(vlist)
|
||||
waiting_times = super().create(vlist)
|
||||
cls.update_laboratory_notebook(waiting_times)
|
||||
return waiting_times
|
||||
|
||||
@classmethod
|
||||
def write(cls, *args):
|
||||
super(LabMethodWaitingTime, cls).write(*args)
|
||||
super().write(*args)
|
||||
actions = iter(args)
|
||||
for waiting_times, vals in zip(actions, actions):
|
||||
if 'results_estimated_waiting' in vals:
|
||||
|
@ -269,7 +269,7 @@ class LabMethodWaitingTime(ModelSQL, ModelView):
|
|||
def delete(cls, waiting_times):
|
||||
waiting = waiting_times[0].method.results_estimated_waiting
|
||||
cls.update_laboratory_notebook(waiting_times, waiting)
|
||||
super(LabMethodWaitingTime, cls).delete(waiting_times)
|
||||
super().delete(waiting_times)
|
||||
|
||||
|
||||
class LabDevice(DeactivableMixin, ModelSQL, ModelView):
|
||||
|
@ -289,7 +289,7 @@ class LabDevice(DeactivableMixin, ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(LabDevice, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('code_uniq', Unique(t, t.code),
|
||||
|
@ -315,7 +315,7 @@ class LabDevice(DeactivableMixin, ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def write(cls, *args):
|
||||
super(LabDevice, cls).write(*args)
|
||||
super().write(*args)
|
||||
actions = iter(args)
|
||||
for devices, vals in zip(actions, actions):
|
||||
if 'active' in vals:
|
||||
|
@ -372,7 +372,7 @@ class LabDeviceType(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(LabDeviceType, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('code_uniq', Unique(t, t.code),
|
||||
|
@ -423,7 +423,7 @@ class LabDeviceLaboratory(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def validate(cls, laboratories):
|
||||
super(LabDeviceLaboratory, cls).validate(laboratories)
|
||||
super().validate(laboratories)
|
||||
for l in laboratories:
|
||||
l.check_location()
|
||||
|
||||
|
@ -451,12 +451,12 @@ class LabDeviceCorrection(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(LabDeviceCorrection, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('result_from', 'ASC'))
|
||||
|
||||
@classmethod
|
||||
def validate(cls, corrections):
|
||||
super(LabDeviceCorrection, cls).validate(corrections)
|
||||
super().validate(corrections)
|
||||
for correction in corrections:
|
||||
try:
|
||||
float(correction.result_from)
|
||||
|
@ -797,7 +797,7 @@ class NotebookRuleCondition(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def validate(cls, conditions):
|
||||
super(NotebookRuleCondition, cls).validate(conditions)
|
||||
super().validate(conditions)
|
||||
for c in conditions:
|
||||
c.check_field()
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ class Notebook(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Notebook, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('fraction', 'DESC'))
|
||||
|
||||
def get_rec_name(self, name):
|
||||
|
@ -534,7 +534,7 @@ class Notebook(ModelSQL, ModelView):
|
|||
@classmethod
|
||||
def view_toolbar_get(cls):
|
||||
if not Transaction().context.get('samples_pending_reporting', False):
|
||||
return super(Notebook, cls).view_toolbar_get()
|
||||
return super().view_toolbar_get()
|
||||
|
||||
# Samples Pending Reporting uses specific keywords
|
||||
prints = cls.get_samples_pending_reporting_keyword('form_print')
|
||||
|
@ -854,7 +854,7 @@ class NotebookLine(ModelSQL, ModelView):
|
|||
def __register__(cls, module_name):
|
||||
table_h = cls.__table_handler__(module_name)
|
||||
urgent_exist = table_h.column_exist('urgent')
|
||||
super(NotebookLine, cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
if not urgent_exist:
|
||||
cursor = Transaction().connection.cursor()
|
||||
Service = Pool().get('lims.service')
|
||||
|
@ -865,7 +865,7 @@ class NotebookLine(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(NotebookLine, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('analysis_order', 'ASC'))
|
||||
cls._order.insert(1, ('repetition', 'ASC'))
|
||||
|
||||
|
@ -903,14 +903,14 @@ class NotebookLine(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def create(cls, vlist):
|
||||
lines = super(NotebookLine, cls).create(vlist)
|
||||
lines = super().create(vlist)
|
||||
cls.update_detail_report(lines)
|
||||
return lines
|
||||
|
||||
@classmethod
|
||||
def write(cls, *args):
|
||||
Sample = Pool().get('lims.sample')
|
||||
super(NotebookLine, cls).write(*args)
|
||||
super().write(*args)
|
||||
actions = iter(args)
|
||||
for lines, vals in zip(actions, actions):
|
||||
if vals.get('not_accepted_message'):
|
||||
|
@ -983,7 +983,7 @@ class NotebookLine(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def validate(cls, notebook_lines):
|
||||
super(NotebookLine, cls).validate(notebook_lines)
|
||||
super().validate(notebook_lines)
|
||||
for line in notebook_lines:
|
||||
line.check_end_date()
|
||||
line.check_accepted()
|
||||
|
@ -1145,7 +1145,7 @@ class NotebookLine(ModelSQL, ModelView):
|
|||
Config = pool.get('lims.configuration')
|
||||
UiView = pool.get('ir.ui.view')
|
||||
|
||||
result = super(NotebookLine, cls).fields_view_get(view_id=view_id,
|
||||
result = super().fields_view_get(view_id=view_id,
|
||||
view_type=view_type)
|
||||
|
||||
# All Notebook Lines view
|
||||
|
@ -1499,7 +1499,7 @@ class NotebookLineAllFields(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(NotebookLineAllFields, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('fraction', 'DESC'))
|
||||
cls._order.insert(1, ('analysis', 'ASC'))
|
||||
cls._order.insert(2, ('repetition', 'ASC'))
|
||||
|
@ -2137,8 +2137,7 @@ class NotebookInternalRelationsCalc1Relation(ModelSQL):
|
|||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
super(NotebookInternalRelationsCalc1Relation,
|
||||
cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
cursor = Transaction().connection.cursor()
|
||||
cursor.execute('DELETE FROM "' + cls._table + '"')
|
||||
|
||||
|
@ -2495,8 +2494,7 @@ class NotebookInternalRelationsCalc2Relation(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
super(NotebookInternalRelationsCalc2Relation,
|
||||
cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
cursor = Transaction().connection.cursor()
|
||||
cursor.execute('DELETE FROM "' + cls._table + '"')
|
||||
|
||||
|
@ -2547,7 +2545,7 @@ class NotebookInternalRelationsCalc2Variable(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(NotebookInternalRelationsCalc2Variable, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('relation', 'ASC'))
|
||||
cls._order.insert(1, ('analysis', 'ASC'))
|
||||
cls._order.insert(2, ('repetition', 'ASC'))
|
||||
|
@ -2989,7 +2987,7 @@ class NotebookLoadResultsFormulaLine(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
super(NotebookLoadResultsFormulaLine, cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
cursor = Transaction().connection.cursor()
|
||||
cursor.execute('DELETE FROM "' + cls._table + '"')
|
||||
|
||||
|
@ -3025,8 +3023,7 @@ class NotebookLoadResultsFormulaAction(ModelSQL):
|
|||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
super(NotebookLoadResultsFormulaAction,
|
||||
cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
cursor = Transaction().connection.cursor()
|
||||
cursor.execute('DELETE FROM "' + cls._table + '"')
|
||||
|
||||
|
@ -3157,8 +3154,7 @@ class NotebookLoadResultsFormulaSit2Detail(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
super(NotebookLoadResultsFormulaSit2Detail,
|
||||
cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
cursor = Transaction().connection.cursor()
|
||||
cursor.execute('DELETE FROM "' + cls._table + '"')
|
||||
|
||||
|
@ -3778,8 +3774,7 @@ class NotebookLoadResultsManualLine(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
super(NotebookLoadResultsManualLine,
|
||||
cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
cursor = Transaction().connection.cursor()
|
||||
cursor.execute('DELETE FROM "' + cls._table + '"')
|
||||
|
||||
|
@ -5125,8 +5120,7 @@ class NotebookLinePrecisionControl(NotebookPrecisionControl):
|
|||
|
||||
reference_line = NotebookLine(Transaction().context['active_id'])
|
||||
with Transaction().set_context(active_id=reference_line.notebook.id):
|
||||
return super(NotebookLinePrecisionControl,
|
||||
self).default_start(fields)
|
||||
return super().default_start(fields)
|
||||
|
||||
def transition_ok(self):
|
||||
NotebookLine = Pool().get('lims.notebook.line')
|
||||
|
@ -5262,8 +5256,7 @@ class AnalysisPendingInform(Report):
|
|||
Laboratory = pool.get('lims.laboratory')
|
||||
Party = pool.get('party.party')
|
||||
|
||||
report_context = super(AnalysisPendingInform, cls).get_context(
|
||||
records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
today = get_print_date()
|
||||
report_context['today'] = today
|
||||
|
@ -5410,8 +5403,7 @@ class AnalysisCheckedPendingInform(Report):
|
|||
Laboratory = pool.get('lims.laboratory')
|
||||
Party = pool.get('party.party')
|
||||
|
||||
report_context = super(AnalysisCheckedPendingInform, cls).get_context(
|
||||
records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
today = get_print_date()
|
||||
report_context['today'] = today
|
||||
|
|
|
@ -31,7 +31,7 @@ class Party(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Party, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('lims_user_uniq', Unique(t, t.lims_user),
|
||||
|
|
|
@ -105,7 +105,7 @@ class Planification(Workflow, ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Planification, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('code', 'DESC'))
|
||||
cls._transitions |= set((
|
||||
('draft', 'preplanned'),
|
||||
|
@ -250,7 +250,7 @@ class Planification(Workflow, ModelSQL, ModelView):
|
|||
for values in vlist:
|
||||
values['code'] = Sequence.get_id(
|
||||
config.planification_sequence.id)
|
||||
return super(Planification, cls).create(vlist)
|
||||
return super().create(vlist)
|
||||
|
||||
@classmethod
|
||||
def check_delete(cls, planifications):
|
||||
|
@ -262,7 +262,7 @@ class Planification(Workflow, ModelSQL, ModelView):
|
|||
@classmethod
|
||||
def delete(cls, planifications):
|
||||
cls.check_delete(planifications)
|
||||
super(Planification, cls).delete(planifications)
|
||||
super().delete(planifications)
|
||||
|
||||
@classmethod
|
||||
def copy(cls, planifications, default=None):
|
||||
|
@ -570,7 +570,7 @@ class PlanificationTechnician(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(PlanificationTechnician, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('planification_professional_uniq',
|
||||
|
@ -663,7 +663,7 @@ class PlanificationDetail(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(PlanificationDetail, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('fraction', 'ASC'))
|
||||
cls._order.insert(1, ('service_analysis', 'ASC'))
|
||||
|
||||
|
@ -900,7 +900,7 @@ class LabProfessionalMethod(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(LabProfessionalMethod, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('professional', 'ASC'))
|
||||
cls._order.insert(1, ('method', 'ASC'))
|
||||
t = cls.__table__()
|
||||
|
@ -1065,14 +1065,13 @@ class RelateTechniciansDetail1(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
super(RelateTechniciansDetail1,
|
||||
cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
cursor = Transaction().connection.cursor()
|
||||
cursor.execute('DELETE FROM "' + cls._table + '"')
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(RelateTechniciansDetail1, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('fraction', 'ASC'))
|
||||
cls._order.insert(1, ('service_analysis', 'ASC'))
|
||||
|
||||
|
@ -1107,14 +1106,13 @@ class RelateTechniciansDetail2(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
super(RelateTechniciansDetail2,
|
||||
cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
cursor = Transaction().connection.cursor()
|
||||
cursor.execute('DELETE FROM "' + cls._table + '"')
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(RelateTechniciansDetail2, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('fraction', 'ASC'))
|
||||
cls._order.insert(1, ('analysis_origin', 'ASC'))
|
||||
cls._order.insert(2, ('method', 'ASC'))
|
||||
|
@ -1131,14 +1129,13 @@ class RelateTechniciansDetail3(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
super(RelateTechniciansDetail3,
|
||||
cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
cursor = Transaction().connection.cursor()
|
||||
cursor.execute('DELETE FROM "' + cls._table + '"')
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(RelateTechniciansDetail3, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('fraction', 'ASC'))
|
||||
cls._order.insert(1, ('analysis_origin', 'ASC'))
|
||||
|
||||
|
@ -1559,14 +1556,13 @@ class UnlinkTechniciansDetail1(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
super(UnlinkTechniciansDetail1,
|
||||
cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
cursor = Transaction().connection.cursor()
|
||||
cursor.execute('DELETE FROM "' + cls._table + '"')
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(UnlinkTechniciansDetail1, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('fraction', 'ASC'))
|
||||
cls._order.insert(1, ('service_analysis', 'ASC'))
|
||||
|
||||
|
@ -3728,14 +3724,13 @@ class SearchFractionsDetail(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
super(SearchFractionsDetail,
|
||||
cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
cursor = Transaction().connection.cursor()
|
||||
cursor.execute('DELETE FROM "' + cls._table + '"')
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(SearchFractionsDetail, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('fraction', 'ASC'))
|
||||
cls._order.insert(1, ('service_analysis', 'ASC'))
|
||||
|
||||
|
@ -4824,8 +4819,7 @@ class QualificationSituation(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
super(QualificationSituation,
|
||||
cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
cursor = Transaction().connection.cursor()
|
||||
cursor.execute('DELETE FROM "' + cls._table + '"')
|
||||
|
||||
|
@ -4842,8 +4836,7 @@ class QualificationAction(ModelSQL):
|
|||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
super(QualificationAction,
|
||||
cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
cursor = Transaction().connection.cursor()
|
||||
cursor.execute('DELETE FROM "' + cls._table + '"')
|
||||
|
||||
|
@ -5572,8 +5565,7 @@ class PlanificationSequenceReport(Report):
|
|||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
report_context = super(PlanificationSequenceReport,
|
||||
cls).get_context(records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
report_context['company'] = report_context['user'].company
|
||||
|
||||
|
@ -5655,8 +5647,7 @@ class PlanificationWorksheetAnalysisReport(Report):
|
|||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
report_context = super(PlanificationWorksheetAnalysisReport,
|
||||
cls).get_context(records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
report_context['company'] = report_context['user'].company
|
||||
|
||||
|
@ -5770,8 +5761,7 @@ class PlanificationWorksheetMethodReport(Report):
|
|||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
report_context = super(PlanificationWorksheetMethodReport,
|
||||
cls).get_context(records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
report_context['company'] = report_context['user'].company
|
||||
|
||||
|
@ -5943,8 +5933,7 @@ class PlanificationWorksheetReport(Report):
|
|||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
report_context = super(PlanificationWorksheetReport,
|
||||
cls).get_context(records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
report_context['company'] = report_context['user'].company
|
||||
|
||||
|
@ -6183,8 +6172,7 @@ class PendingServicesUnplannedReport(Report):
|
|||
Laboratory = pool.get('lims.laboratory')
|
||||
EntryDetailAnalysis = pool.get('lims.entry.detail.analysis')
|
||||
|
||||
report_context = super(PendingServicesUnplannedReport,
|
||||
cls).get_context(records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
report_context['company'] = report_context['user'].company
|
||||
report_context['start_date'] = (data['start_date']
|
||||
|
@ -6337,8 +6325,7 @@ class PendingServicesUnplannedSpreadsheet(Report):
|
|||
Laboratory = pool.get('lims.laboratory')
|
||||
EntryDetailAnalysis = pool.get('lims.entry.detail.analysis')
|
||||
|
||||
report_context = super(PendingServicesUnplannedSpreadsheet,
|
||||
cls).get_context(records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
report_context['company'] = report_context['user'].company
|
||||
report_context['start_date'] = (data['start_date']
|
||||
|
@ -6516,7 +6503,7 @@ class BlindSampleReport(Report):
|
|||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
report_context = super(BlindSampleReport, cls).get_context(records,
|
||||
report_context = super().get_context(records,
|
||||
data)
|
||||
BlindSample = Pool().get('lims.blind_sample')
|
||||
|
||||
|
@ -6661,8 +6648,7 @@ class PlanificationSequenceAnalysisReport(Report):
|
|||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
report_context = super(PlanificationSequenceAnalysisReport,
|
||||
cls).get_context(records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
report_context['company'] = report_context['user'].company
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ class ResultsReport(ModelSQL, ModelView):
|
|||
table_h = cls.__table_handler__(module_name)
|
||||
notebook_exist = table_h.column_exist('notebook')
|
||||
entry_exist = table_h.column_exist('entry')
|
||||
super(ResultsReport, cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
if notebook_exist and not entry_exist:
|
||||
cursor = Transaction().connection.cursor()
|
||||
cursor.execute('UPDATE "lims_results_report" r '
|
||||
|
@ -91,7 +91,7 @@ class ResultsReport(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ResultsReport, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('number', 'DESC'))
|
||||
|
||||
@staticmethod
|
||||
|
@ -114,7 +114,7 @@ class ResultsReport(ModelSQL, ModelView):
|
|||
vlist = [x.copy() for x in vlist]
|
||||
for values in vlist:
|
||||
values['number'] = Sequence.get_id(sequence.id)
|
||||
return super(ResultsReport, cls).create(vlist)
|
||||
return super().create(vlist)
|
||||
|
||||
@classmethod
|
||||
def write(cls, *args):
|
||||
|
@ -125,7 +125,7 @@ class ResultsReport(ModelSQL, ModelView):
|
|||
if field in vals:
|
||||
vals['write_date2'] = datetime.now()
|
||||
break
|
||||
super(ResultsReport, cls).write(*args)
|
||||
super().write(*args)
|
||||
|
||||
@staticmethod
|
||||
def _get_modified_fields():
|
||||
|
@ -204,7 +204,7 @@ class ResultsReportVersion(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ResultsReportVersion, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('number', 'DESC'))
|
||||
|
||||
def get_report_type(self, name):
|
||||
|
@ -240,7 +240,7 @@ class ResultsReportVersion(ModelSQL, ModelView):
|
|||
for values in vlist:
|
||||
values['number'] = cls.get_number(values['results_report'],
|
||||
values['laboratory'])
|
||||
return super(ResultsReportVersion, cls).create(vlist)
|
||||
return super().create(vlist)
|
||||
|
||||
|
||||
class ResultsReportVersionDetail(ModelSQL, ModelView):
|
||||
|
@ -377,7 +377,7 @@ class ResultsReportVersionDetail(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ResultsReportVersionDetail, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('report_version', 'DESC'))
|
||||
cls._order.insert(1, ('number', 'DESC'))
|
||||
cls._buttons.update({
|
||||
|
@ -420,7 +420,7 @@ class ResultsReportVersionDetail(ModelSQL, ModelView):
|
|||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
cursor = Transaction().connection.cursor()
|
||||
super(ResultsReportVersionDetail, cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
cursor.execute('UPDATE "' + cls._table + '" '
|
||||
'SET state = \'released\' '
|
||||
'WHERE state = \'revised\' '
|
||||
|
@ -469,7 +469,7 @@ class ResultsReportVersionDetail(ModelSQL, ModelView):
|
|||
d_count[key] = 0
|
||||
d_count[key] += 1
|
||||
values['number'] = cls.get_next_number(key, d_count[key])
|
||||
return super(ResultsReportVersionDetail, cls).create(vlist)
|
||||
return super().create(vlist)
|
||||
|
||||
def get_rec_name(self, name):
|
||||
return '%s-%s' % (self.report_version.number, self.number)
|
||||
|
@ -896,7 +896,7 @@ class ResultsReportVersionDetail(ModelSQL, ModelView):
|
|||
@classmethod
|
||||
def delete(cls, details):
|
||||
cls.check_delete(details)
|
||||
super(ResultsReportVersionDetail, cls).delete(details)
|
||||
super().delete(details)
|
||||
|
||||
@classmethod
|
||||
def check_delete(cls, details):
|
||||
|
@ -978,7 +978,7 @@ class ResultsReportVersionDetailSample(ModelSQL, ModelView):
|
|||
@classmethod
|
||||
def create(cls, vlist):
|
||||
Sample = Pool().get('lims.sample')
|
||||
samples = super(ResultsReportVersionDetailSample, cls).create(vlist)
|
||||
samples = super().create(vlist)
|
||||
sample_ids = list(set(s.notebook.fraction.sample.id for s in samples))
|
||||
Sample.update_samples_state(sample_ids)
|
||||
return samples
|
||||
|
@ -987,7 +987,7 @@ class ResultsReportVersionDetailSample(ModelSQL, ModelView):
|
|||
def delete(cls, samples):
|
||||
Sample = Pool().get('lims.sample')
|
||||
sample_ids = list(set(s.notebook.fraction.sample.id for s in samples))
|
||||
super(ResultsReportVersionDetailSample, cls).delete(samples)
|
||||
super().delete(samples)
|
||||
Sample.update_samples_state(sample_ids)
|
||||
|
||||
|
||||
|
@ -1033,7 +1033,7 @@ class ResultsReportVersionDetailLine(ModelSQL, ModelView):
|
|||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
table_h = cls.__table_handler__(module_name)
|
||||
super(ResultsReportVersionDetailLine, cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
if table_h.column_exist('report_version_detail'):
|
||||
cls._migrate_lines()
|
||||
table_h.drop_column('report_version_detail')
|
||||
|
@ -1266,8 +1266,7 @@ class DivideReportsDetail(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
super(DivideReportsDetail,
|
||||
cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
cursor = Transaction().connection.cursor()
|
||||
cursor.execute('DELETE FROM "' + cls._table + '"')
|
||||
|
||||
|
@ -1427,8 +1426,7 @@ class GenerateResultsReportResultAutNotebook(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
super(GenerateResultsReportResultAutNotebook,
|
||||
cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
cursor = Transaction().connection.cursor()
|
||||
cursor.execute('DELETE FROM "' + cls._table + '"')
|
||||
|
||||
|
@ -1483,8 +1481,7 @@ class GenerateResultsReportResultAutExcludedNotebook(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
super(GenerateResultsReportResultAutExcludedNotebook,
|
||||
cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
cursor = Transaction().connection.cursor()
|
||||
cursor.execute('DELETE FROM "' + cls._table + '"')
|
||||
|
||||
|
@ -3170,7 +3167,7 @@ class ResultReport(Report):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ResultReport, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls.__rpc__['execute'] = RPC(False)
|
||||
|
||||
@classmethod
|
||||
|
@ -3187,9 +3184,9 @@ class ResultReport(Report):
|
|||
data = {}
|
||||
current_data = data.copy()
|
||||
current_data['alt_lang'] = None
|
||||
result_orig = super(ResultReport, cls).execute(ids, current_data)
|
||||
result_orig = super().execute(ids, current_data)
|
||||
current_data['alt_lang'] = 'en'
|
||||
result_eng = super(ResultReport, cls).execute(ids, current_data)
|
||||
result_eng = super().execute(ids, current_data)
|
||||
|
||||
save = False
|
||||
if results_report.english_report:
|
||||
|
@ -3229,8 +3226,7 @@ class ResultReport(Report):
|
|||
Sample = pool.get('lims.sample')
|
||||
RangeType = pool.get('lims.range.type')
|
||||
|
||||
report_context = super(ResultReport, cls).get_context(
|
||||
records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
if data.get('alt_lang'):
|
||||
lang_code = data['alt_lang']
|
||||
|
@ -4073,9 +4069,9 @@ class ResultReportTranscription(ResultReport):
|
|||
data = {}
|
||||
current_data = data.copy()
|
||||
current_data['alt_lang'] = None
|
||||
result_orig = super(ResultReport, cls).execute(ids, current_data)
|
||||
result_orig = super().execute(ids, current_data)
|
||||
current_data['alt_lang'] = 'en'
|
||||
result_eng = super(ResultReport, cls).execute(ids, current_data)
|
||||
result_eng = super().execute(ids, current_data)
|
||||
|
||||
save = False
|
||||
if results_report.english_report:
|
||||
|
@ -4114,7 +4110,7 @@ class GlobalResultReport(Report):
|
|||
def execute(cls, ids, data):
|
||||
ResultsReport = Pool().get('lims.results_report')
|
||||
|
||||
result = super(GlobalResultReport, cls).execute(ids, data)
|
||||
result = super().execute(ids, data)
|
||||
|
||||
results_report = ResultsReport(ids[0])
|
||||
if results_report.english_report:
|
||||
|
|
|
@ -55,7 +55,7 @@ class Zone(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Zone, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('code_uniq', Unique(t, t.code),
|
||||
|
@ -92,7 +92,7 @@ class Variety(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Variety, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('code_uniq', Unique(t, t.code),
|
||||
|
@ -137,7 +137,7 @@ class PackagingIntegrity(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(PackagingIntegrity, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('code_uniq', Unique(t, t.code),
|
||||
|
@ -175,7 +175,7 @@ class PackagingType(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(PackagingType, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('code_uniq', Unique(t, t.code),
|
||||
|
@ -224,7 +224,7 @@ class FractionType(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(FractionType, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._order.insert(0, ('code', 'ASC'))
|
||||
cls._sql_constraints += [
|
||||
|
@ -409,7 +409,7 @@ class Service(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Service, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('number', 'DESC'))
|
||||
|
||||
@staticmethod
|
||||
|
@ -426,7 +426,7 @@ class Service(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def validate(cls, services):
|
||||
super(Service, cls).validate(services)
|
||||
super().validate(services)
|
||||
for service in services:
|
||||
service.check_duplicated_analysis()
|
||||
|
||||
|
@ -477,7 +477,7 @@ class Service(ModelSQL, ModelView):
|
|||
vlist = [x.copy() for x in vlist]
|
||||
for values in vlist:
|
||||
values['number'] = Sequence.get_id(sequence.id)
|
||||
services = super(Service, cls).create(vlist)
|
||||
services = super().create(vlist)
|
||||
|
||||
if not Transaction().context.get('copying', False):
|
||||
cls.update_analysis_detail(services)
|
||||
|
@ -512,7 +512,7 @@ class Service(ModelSQL, ModelView):
|
|||
@classmethod
|
||||
def write(cls, *args):
|
||||
Sample = Pool().get('lims.sample')
|
||||
super(Service, cls).write(*args)
|
||||
super().write(*args)
|
||||
actions = iter(args)
|
||||
for services, vals in zip(actions, actions):
|
||||
change_detail = False
|
||||
|
@ -541,7 +541,7 @@ class Service(ModelSQL, ModelView):
|
|||
cls.check_delete(services)
|
||||
fractions_ids = list(set(s.fraction.id for s in services))
|
||||
sample_ids = list(set(s.sample.id for s in services))
|
||||
super(Service, cls).delete(services)
|
||||
super().delete(services)
|
||||
cls.set_shared_fraction(fractions_ids)
|
||||
Sample.update_samples_state(sample_ids)
|
||||
|
||||
|
@ -820,7 +820,7 @@ class Service(ModelSQL, ModelView):
|
|||
new_services = []
|
||||
for service in sorted(services, key=lambda x: x.number):
|
||||
with Transaction().set_context(copying=True):
|
||||
new_service, = super(Service, cls).copy([service],
|
||||
new_service, = super().copy([service],
|
||||
default=current_default)
|
||||
detail_default['service'] = new_service.id
|
||||
EntryDetailAnalysis.copy(service.analysis_detail,
|
||||
|
@ -1429,7 +1429,7 @@ class Fraction(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Fraction, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('number', 'DESC'))
|
||||
cls._buttons.update({
|
||||
'manage_services': {
|
||||
|
@ -1483,7 +1483,7 @@ class Fraction(ModelSQL, ModelView):
|
|||
f_count[values['sample']] += 1
|
||||
values['number'] = cls.get_next_number(values['sample'],
|
||||
f_count[values['sample']])
|
||||
return super(Fraction, cls).create(vlist)
|
||||
return super().create(vlist)
|
||||
|
||||
@classmethod
|
||||
def view_attributes(cls):
|
||||
|
@ -1526,7 +1526,7 @@ class Fraction(ModelSQL, ModelView):
|
|||
current_default['countersample_date'] = None
|
||||
current_default['countersample_location'] = None
|
||||
|
||||
new_fraction, = super(Fraction, cls).copy([fraction],
|
||||
new_fraction, = super().copy([fraction],
|
||||
default=current_default)
|
||||
new_fractions.append(new_fraction)
|
||||
return new_fractions
|
||||
|
@ -1541,7 +1541,7 @@ class Fraction(ModelSQL, ModelView):
|
|||
@classmethod
|
||||
def delete(cls, fractions):
|
||||
cls.check_delete(fractions)
|
||||
super(Fraction, cls).delete(fractions)
|
||||
super().delete(fractions)
|
||||
|
||||
@fields.depends('type', 'storage_location')
|
||||
def on_change_with_storage_time(self, name=None):
|
||||
|
@ -2469,7 +2469,7 @@ class Sample(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Sample, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('number', 'DESC'))
|
||||
cls.__rpc__.update({
|
||||
'update_samples_state': RPC(readonly=False, instantiate=0),
|
||||
|
@ -2498,7 +2498,7 @@ class Sample(ModelSQL, ModelView):
|
|||
|
||||
new_samples = []
|
||||
for sample in sorted(samples, key=lambda x: x.number):
|
||||
new_sample, = super(Sample, cls).copy([sample],
|
||||
new_sample, = super().copy([sample],
|
||||
default=default)
|
||||
new_samples.append(new_sample)
|
||||
return new_samples
|
||||
|
@ -2565,7 +2565,7 @@ class Sample(ModelSQL, ModelView):
|
|||
vlist = [x.copy() for x in vlist]
|
||||
for values in vlist:
|
||||
values['number'] = Sequence.get_id(sequence.id)
|
||||
samples = super(Sample, cls).create(vlist)
|
||||
samples = super().create(vlist)
|
||||
for sample in samples:
|
||||
sample.warn_duplicated_label()
|
||||
return samples
|
||||
|
@ -2587,7 +2587,7 @@ class Sample(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def write(cls, *args):
|
||||
super(Sample, cls).write(*args)
|
||||
super().write(*args)
|
||||
actions = iter(args)
|
||||
for samples, vals in zip(actions, actions):
|
||||
if vals.get('label'):
|
||||
|
@ -2744,7 +2744,7 @@ class Sample(ModelSQL, ModelView):
|
|||
@classmethod
|
||||
def delete(cls, samples):
|
||||
cls.check_delete(samples)
|
||||
super(Sample, cls).delete(samples)
|
||||
super().delete(samples)
|
||||
|
||||
@staticmethod
|
||||
def default_entry_view():
|
||||
|
@ -5500,8 +5500,7 @@ class CountersampleStorageReport(Report):
|
|||
Fraction = pool.get('lims.fraction')
|
||||
NotebookLine = pool.get('lims.notebook.line')
|
||||
|
||||
report_context = super(CountersampleStorageReport,
|
||||
cls).get_context(records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
report_context['company'] = report_context['user'].company
|
||||
report_context['report_date_from'] = data['report_date_from']
|
||||
|
@ -5700,8 +5699,7 @@ class CountersampleDischargeReport(Report):
|
|||
pool = Pool()
|
||||
Fraction = pool.get('lims.fraction')
|
||||
|
||||
report_context = super(CountersampleDischargeReport,
|
||||
cls).get_context(records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
report_context['company'] = report_context['user'].company
|
||||
report_context['expiry_date_from'] = data['expiry_date_from']
|
||||
|
@ -5801,7 +5799,7 @@ class Referral(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Referral, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('date', 'DESC'))
|
||||
cls._buttons.update({
|
||||
'send': {
|
||||
|
|
|
@ -46,12 +46,12 @@ class Move(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Move, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls.origin.readonly = True
|
||||
|
||||
@classmethod
|
||||
def _get_origin(cls):
|
||||
models = super(Move, cls)._get_origin()
|
||||
models = super()._get_origin()
|
||||
models.append('lims.fraction')
|
||||
return models
|
||||
|
||||
|
@ -73,7 +73,7 @@ class Move(metaclass=PoolMeta):
|
|||
@classmethod
|
||||
def copy(cls, moves, default=None):
|
||||
with Transaction().set_context(check_current_location=False):
|
||||
return super(Move, cls).copy(moves, default=default)
|
||||
return super().copy(moves, default=default)
|
||||
|
||||
|
||||
class ShipmentInternal(metaclass=PoolMeta):
|
||||
|
@ -82,50 +82,49 @@ class ShipmentInternal(metaclass=PoolMeta):
|
|||
@classmethod
|
||||
def copy(cls, shipments, default=None):
|
||||
with Transaction().set_context(check_current_location=False):
|
||||
return super(ShipmentInternal, cls).copy(shipments,
|
||||
default=default)
|
||||
return super().copy(shipments, default=default)
|
||||
|
||||
@classmethod
|
||||
def _sync_moves(cls, shipments):
|
||||
with Transaction().set_context(check_current_location=False):
|
||||
super(ShipmentInternal, cls)._sync_moves(shipments)
|
||||
super()._sync_moves(shipments)
|
||||
|
||||
@classmethod
|
||||
def _set_transit(cls, shipments):
|
||||
with Transaction().set_context(check_current_location=False):
|
||||
super(ShipmentInternal, cls)._set_transit(shipments)
|
||||
super()._set_transit(shipments)
|
||||
|
||||
@classmethod
|
||||
def draft(cls, shipments):
|
||||
with Transaction().set_context(check_current_location=False):
|
||||
super(ShipmentInternal, cls).draft(shipments)
|
||||
super().draft(shipments)
|
||||
|
||||
@classmethod
|
||||
def wait(cls, shipments):
|
||||
with Transaction().set_context(check_current_location=False):
|
||||
super(ShipmentInternal, cls).wait(shipments)
|
||||
super().wait(shipments)
|
||||
|
||||
@classmethod
|
||||
def ship(cls, shipments):
|
||||
with Transaction().set_context(check_current_location=False):
|
||||
super(ShipmentInternal, cls).ship(shipments)
|
||||
super().ship(shipments)
|
||||
|
||||
@classmethod
|
||||
def done(cls, shipments):
|
||||
with Transaction().set_context(check_current_location=False):
|
||||
super(ShipmentInternal, cls).done(shipments)
|
||||
super().done(shipments)
|
||||
|
||||
@classmethod
|
||||
def cancel(cls, shipments):
|
||||
with Transaction().set_context(check_current_location=False):
|
||||
super(ShipmentInternal, cls).cancel(shipments)
|
||||
super().cancel(shipments)
|
||||
|
||||
@classmethod
|
||||
def assign_try(cls, shipments):
|
||||
with Transaction().set_context(check_current_location=False):
|
||||
return super(ShipmentInternal, cls).assign_try(shipments)
|
||||
return super().assign_try(shipments)
|
||||
|
||||
@classmethod
|
||||
def assign_force(cls, shipments):
|
||||
with Transaction().set_context(check_current_location=False):
|
||||
super(ShipmentInternal, cls).assign_force(shipments)
|
||||
super().assign_force(shipments)
|
||||
|
|
|
@ -18,7 +18,7 @@ class Uom(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Uom, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls.symbol.size = 30
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
|
@ -70,7 +70,7 @@ class Template(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Template, cls).__setup__()
|
||||
super().__setup__()
|
||||
new_domain = [('category.lims_only_available', '!=', True)]
|
||||
cls.default_uom.domain = new_domain
|
||||
|
||||
|
@ -95,7 +95,7 @@ class VolumeConversion(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(VolumeConversion, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('brix', 'ASC'))
|
||||
|
||||
@staticmethod
|
||||
|
@ -217,7 +217,7 @@ class ConcentrationLevel(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ConcentrationLevel, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('code_uniq', Unique(t, t.code),
|
||||
|
|
|
@ -48,13 +48,13 @@ class Invoice(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Invoice, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._check_modify_exclude.extend(['sent', 'sent_date',
|
||||
'invoice_contacts', 'no_send_invoice'])
|
||||
|
||||
@classmethod
|
||||
def view_attributes(cls):
|
||||
return super(Invoice, cls).view_attributes() + [
|
||||
return super().view_attributes() + [
|
||||
('/form/notebook/page[@id="contacts"]', 'states', {
|
||||
'invisible': Eval('type') == 'in',
|
||||
}),
|
||||
|
@ -62,13 +62,13 @@ class Invoice(metaclass=PoolMeta):
|
|||
|
||||
@fields.depends('party')
|
||||
def on_change_party(self):
|
||||
super(Invoice, self).on_change_party()
|
||||
super().on_change_party()
|
||||
self.no_send_invoice = False
|
||||
if self.party:
|
||||
self.no_send_invoice = self.party.no_send_invoice
|
||||
|
||||
def _credit(self):
|
||||
credit = super(Invoice, self)._credit()
|
||||
credit = super()._credit()
|
||||
if self.invoice_contacts:
|
||||
credit.invoice_contacts = [contact._credit()
|
||||
for contact in self.invoice_contacts]
|
||||
|
@ -80,7 +80,7 @@ class Invoice(metaclass=PoolMeta):
|
|||
@Workflow.transition('posted')
|
||||
def post(cls, invoices):
|
||||
cls.check_invoice_contacts(invoices)
|
||||
super(Invoice, cls).post(invoices)
|
||||
super().post(invoices)
|
||||
|
||||
@classmethod
|
||||
def check_invoice_contacts(cls, invoices):
|
||||
|
@ -271,7 +271,7 @@ class InvoiceLine(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(InvoiceLine, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls.origin.states['readonly'] = True
|
||||
cls.party.domain = [If(Bool(Eval('party_domain')),
|
||||
('id', 'in', Eval('party_domain')), ('id', '!=', -1))]
|
||||
|
@ -282,7 +282,7 @@ class InvoiceLine(metaclass=PoolMeta):
|
|||
def delete(cls, lines):
|
||||
if not Transaction().context.get('delete_service', False):
|
||||
cls.check_service_invoice(lines)
|
||||
super(InvoiceLine, cls).delete(lines)
|
||||
super().delete(lines)
|
||||
|
||||
@classmethod
|
||||
def check_service_invoice(cls, lines):
|
||||
|
@ -355,7 +355,7 @@ class InvoiceLine(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def _get_origin(cls):
|
||||
models = super(InvoiceLine, cls)._get_origin()
|
||||
models = super()._get_origin()
|
||||
models.append('lims.service')
|
||||
return models
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ class Entry(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def on_hold(cls, entries):
|
||||
super(Entry, cls).on_hold(entries)
|
||||
super().on_hold(entries)
|
||||
cls.create_invoice_lines(entries)
|
||||
|
||||
@classmethod
|
||||
|
@ -50,7 +50,7 @@ class Fraction(metaclass=PoolMeta):
|
|||
def confirm(cls, fractions):
|
||||
fractions_to_invoice = [f for f in fractions if
|
||||
f.sample.entry.state != 'pending']
|
||||
super(Fraction, cls).confirm(fractions)
|
||||
super().confirm(fractions)
|
||||
if fractions_to_invoice:
|
||||
cls.create_invoice_lines(fractions_to_invoice)
|
||||
|
||||
|
@ -71,7 +71,7 @@ class Service(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def create(cls, vlist):
|
||||
services = super(Service, cls).create(vlist)
|
||||
services = super().create(vlist)
|
||||
services_to_invoice = [s for s in services if
|
||||
s.entry.state == 'pending']
|
||||
for service in services_to_invoice:
|
||||
|
@ -141,7 +141,7 @@ class Service(metaclass=PoolMeta):
|
|||
@classmethod
|
||||
def delete(cls, services):
|
||||
cls.delete_invoice_lines(services)
|
||||
super(Service, cls).delete(services)
|
||||
super().delete(services)
|
||||
|
||||
@classmethod
|
||||
def delete_invoice_lines(cls, services):
|
||||
|
@ -167,7 +167,6 @@ class ManageServices(metaclass=PoolMeta):
|
|||
__name__ = 'lims.manage_services'
|
||||
|
||||
def create_service(self, service, fraction):
|
||||
new_service = super(ManageServices, self).create_service(service,
|
||||
fraction)
|
||||
new_service = super().create_service(service, fraction)
|
||||
new_service.create_invoice_line('out')
|
||||
return new_service
|
||||
|
|
|
@ -55,7 +55,7 @@ class Address(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def validate(cls, addresses):
|
||||
super(Address, cls).validate(addresses)
|
||||
super().validate(addresses)
|
||||
for address in addresses:
|
||||
address.check_invoice_type()
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ class Configuration(ModelSingleton, ModelSQL, ModelView,
|
|||
pool = Pool()
|
||||
if field == 'task_sequence':
|
||||
return pool.get('lims.administrative.task.configuration.sequence')
|
||||
return super(Configuration, cls).multivalue_model(field)
|
||||
return super().multivalue_model(field)
|
||||
|
||||
@classmethod
|
||||
def default_task_sequence(cls, **pattern):
|
||||
|
|
|
@ -118,7 +118,7 @@ class AdministrativeTask(Workflow, ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(AdministrativeTask, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('id', 'DESC'))
|
||||
cls._transitions |= set((
|
||||
('draft', 'pending'),
|
||||
|
@ -176,7 +176,7 @@ class AdministrativeTask(Workflow, ModelSQL, ModelView):
|
|||
vlist = [x.copy() for x in vlist]
|
||||
for values in vlist:
|
||||
values['number'] = Sequence.get_id(sequence.id)
|
||||
return super(AdministrativeTask, cls).create(vlist)
|
||||
return super().create(vlist)
|
||||
|
||||
@classmethod
|
||||
def check_delete(cls, tasks):
|
||||
|
@ -189,7 +189,7 @@ class AdministrativeTask(Workflow, ModelSQL, ModelView):
|
|||
@classmethod
|
||||
def delete(cls, tasks):
|
||||
cls.check_delete(tasks)
|
||||
super(AdministrativeTask, cls).delete(tasks)
|
||||
super().delete(tasks)
|
||||
|
||||
def get_date(self, name):
|
||||
return self.create_date.date()
|
||||
|
|
|
@ -30,7 +30,7 @@ class Configuration(metaclass=PoolMeta):
|
|||
pool = Pool()
|
||||
if field == 'analysis_sheet_sequence':
|
||||
return pool.get('lims.configuration.sequence')
|
||||
return super(Configuration, cls).multivalue_model(field)
|
||||
return super().multivalue_model(field)
|
||||
|
||||
|
||||
class ConfigurationSequence(metaclass=PoolMeta):
|
||||
|
|
|
@ -24,7 +24,7 @@ class Compilation(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Compilation, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls.date_time.states['readonly'] = Bool(Eval('analysis_sheet'))
|
||||
if 'analysis_sheet' not in cls.date_time.depends:
|
||||
cls.date_time.depends.append('analysis_sheet')
|
||||
|
@ -65,13 +65,13 @@ class Compilation(metaclass=PoolMeta):
|
|||
new_lines = create_new_lines
|
||||
if self.analysis_sheet:
|
||||
new_lines = False
|
||||
super(Compilation, self).collect_csv(create_new_lines=new_lines)
|
||||
super().collect_csv(create_new_lines=new_lines)
|
||||
|
||||
def collect_excel(self, create_new_lines=True):
|
||||
new_lines = create_new_lines
|
||||
if self.analysis_sheet:
|
||||
new_lines = False
|
||||
super(Compilation, self).collect_excel(create_new_lines=new_lines)
|
||||
super().collect_excel(create_new_lines=new_lines)
|
||||
|
||||
|
||||
class Column(metaclass=PoolMeta):
|
||||
|
@ -144,12 +144,12 @@ class Interface(metaclass=PoolMeta):
|
|||
return 'semicolon'
|
||||
|
||||
def _get_fields_tree_view(self):
|
||||
fields = super(Interface, self)._get_fields_tree_view()
|
||||
fields = super()._get_fields_tree_view()
|
||||
fields.append('<field name="annulled"/>')
|
||||
return fields
|
||||
|
||||
def _get_fields_form_view(self):
|
||||
fields = super(Interface, self)._get_fields_form_view()
|
||||
fields = super()._get_fields_form_view()
|
||||
fields.append('<label name="annulled"/>')
|
||||
fields.append('<field name="annulled"/>')
|
||||
return fields
|
||||
|
@ -159,7 +159,7 @@ class Table(metaclass=PoolMeta):
|
|||
__name__ = 'lims.interface.table'
|
||||
|
||||
def create_table(self):
|
||||
table = super(Table, self).create_table()
|
||||
table = super().create_table()
|
||||
table.add_column('annulled', fields.Boolean._sql_type)
|
||||
return table
|
||||
|
||||
|
@ -168,7 +168,7 @@ class NewAdapter(Adapter):
|
|||
|
||||
def get_fields(self):
|
||||
Data = Pool().get('lims.interface.data')
|
||||
res = super(NewAdapter, self).get_fields()
|
||||
res = super().get_fields()
|
||||
table = Data.get_table()
|
||||
if not table:
|
||||
return res
|
||||
|
@ -185,7 +185,7 @@ class Data(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __post_setup__(cls):
|
||||
super(Data, cls).__post_setup__()
|
||||
super().__post_setup__()
|
||||
cls._fields = NewAdapter()
|
||||
|
||||
def set_field(self, value, field):
|
||||
|
@ -203,7 +203,7 @@ class Data(metaclass=PoolMeta):
|
|||
if not fields_names:
|
||||
fields_names = []
|
||||
fields_names.append('annulled')
|
||||
res = super(Data, cls).fields_get(fields_names)
|
||||
res = super().fields_get(fields_names)
|
||||
readonly = Transaction().context.get('lims_interface_readonly', False)
|
||||
res['annulled']['readonly'] = bool(readonly)
|
||||
return res
|
||||
|
@ -214,4 +214,4 @@ class Data(metaclass=PoolMeta):
|
|||
notebook_lines = [x.notebook_line for x in records
|
||||
if x.notebook_line]
|
||||
NotebookLine.write(notebook_lines, {'start_date': None})
|
||||
super(Data, cls).delete(records)
|
||||
super().delete(records)
|
||||
|
|
|
@ -22,7 +22,7 @@ class NotebookRule(metaclass=PoolMeta):
|
|||
def eval_condition(self, line):
|
||||
if self.analysis_sheet:
|
||||
return False
|
||||
return super(NotebookRule, self).eval_condition(line)
|
||||
return super().eval_condition(line)
|
||||
|
||||
def eval_sheet_condition(self, line):
|
||||
for condition in self.conditions:
|
||||
|
@ -199,4 +199,4 @@ class NotebookRuleCondition(metaclass=PoolMeta):
|
|||
|
||||
def check_field(self):
|
||||
if not self.rule.analysis_sheet:
|
||||
super(NotebookRuleCondition, self).check_field()
|
||||
super().check_field()
|
||||
|
|
|
@ -512,13 +512,13 @@ class RepeatAnalysisStartLine(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
super(RepeatAnalysisStartLine, cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
cursor = Transaction().connection.cursor()
|
||||
cursor.execute('DELETE FROM "' + cls._table + '"')
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(RepeatAnalysisStartLine, cls).__setup__()
|
||||
super().__setup__()
|
||||
|
||||
@classmethod
|
||||
def get_line_field(cls, lines, names):
|
||||
|
|
|
@ -27,7 +27,7 @@ class Planification(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Planification, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._buttons.update({
|
||||
'search_analysis_sheet': {
|
||||
'readonly': (Eval('state') != 'draft'),
|
||||
|
@ -41,7 +41,7 @@ class Planification(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def do_confirm(cls, planifications):
|
||||
super(Planification, cls).do_confirm(planifications)
|
||||
super().do_confirm(planifications)
|
||||
for planification in planifications:
|
||||
planification.create_analysis_sheets()
|
||||
|
||||
|
@ -414,7 +414,7 @@ class RelateTechniciansStart(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(RelateTechniciansStart, cls).__setup__()
|
||||
super().__setup__()
|
||||
grouping = ('analysis_sheet', 'Analysis sheet')
|
||||
if grouping not in cls.grouping.selection:
|
||||
cls.grouping.selection.append(grouping)
|
||||
|
@ -434,14 +434,14 @@ class RelateTechniciansResult(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(RelateTechniciansResult, cls).__setup__()
|
||||
super().__setup__()
|
||||
grouping = ('analysis_sheet', 'Analysis sheet')
|
||||
if grouping not in cls.grouping.selection:
|
||||
cls.grouping.selection.append(grouping)
|
||||
|
||||
@fields.depends('grouping')
|
||||
def on_change_grouping(self):
|
||||
super(RelateTechniciansResult, self).on_change_grouping()
|
||||
super().on_change_grouping()
|
||||
self.details4 = []
|
||||
|
||||
|
||||
|
@ -457,14 +457,13 @@ class RelateTechniciansDetail4(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
super(RelateTechniciansDetail4,
|
||||
cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
cursor = Transaction().connection.cursor()
|
||||
cursor.execute('DELETE FROM "' + cls._table + '"')
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(RelateTechniciansDetail4, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('fraction', 'ASC'))
|
||||
cls._order.insert(1, ('template', 'ASC'))
|
||||
|
||||
|
@ -480,10 +479,10 @@ class RelateTechnicians(metaclass=PoolMeta):
|
|||
if self.start.grouping == 'analysis_sheet':
|
||||
self.result.details4_domain = self._view_details4(planification_id,
|
||||
self.start.exclude_relateds)
|
||||
return super(RelateTechnicians, self).transition_search()
|
||||
return super().transition_search()
|
||||
|
||||
def default_result(self, fields):
|
||||
res = super(RelateTechnicians, self).default_result(fields)
|
||||
res = super().default_result(fields)
|
||||
details4_domain = []
|
||||
if self.result.details4_domain:
|
||||
details4_domain = [d.id for d in self.result.details4_domain]
|
||||
|
@ -552,7 +551,7 @@ class RelateTechnicians(metaclass=PoolMeta):
|
|||
return RelateTechniciansDetail4.create(to_create)
|
||||
|
||||
def _get_details(self, planification_id):
|
||||
details = super(RelateTechnicians, self)._get_details(planification_id)
|
||||
details = super()._get_details(planification_id)
|
||||
if self.start.grouping == 'analysis_sheet':
|
||||
details = self._get_details4(planification_id,
|
||||
self.start.exclude_relateds)
|
||||
|
@ -674,7 +673,7 @@ class PlanificationProfessional(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(PlanificationProfessional, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('name', 'ASC'))
|
||||
|
||||
@classmethod
|
||||
|
@ -790,7 +789,7 @@ class PlanificationProfessionalLine(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(PlanificationProfessionalLine, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('date', 'ASC'))
|
||||
|
||||
@classmethod
|
||||
|
@ -878,7 +877,7 @@ class PlanificationPending(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(PlanificationPending, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('name', 'ASC'))
|
||||
|
||||
@classmethod
|
||||
|
|
|
@ -192,7 +192,7 @@ class TemplateAnalysisSheetAnalysis(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def validate(cls, template_analysis):
|
||||
super(TemplateAnalysisSheetAnalysis, cls).validate(template_analysis)
|
||||
super().validate(template_analysis)
|
||||
for ta in template_analysis:
|
||||
ta.check_duplicated()
|
||||
|
||||
|
@ -272,7 +272,7 @@ class AnalysisSheet(Workflow, ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(AnalysisSheet, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('date', 'DESC'))
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
|
@ -415,7 +415,7 @@ class AnalysisSheet(Workflow, ModelSQL, ModelView):
|
|||
@classmethod
|
||||
def create(cls, vlist):
|
||||
vlist = cls.set_number(vlist)
|
||||
sheets = super(AnalysisSheet, cls).create(vlist)
|
||||
sheets = super().create(vlist)
|
||||
cls.update_compilation(sheets)
|
||||
return sheets
|
||||
|
||||
|
@ -453,7 +453,7 @@ class AnalysisSheet(Workflow, ModelSQL, ModelView):
|
|||
raise UserError(gettext(
|
||||
'lims_analysis_sheet.delete_done_sheet'))
|
||||
compilations = [s.compilation for s in sheets]
|
||||
super(AnalysisSheet, cls).delete(sheets)
|
||||
super().delete(sheets)
|
||||
Compilation.delete(compilations)
|
||||
|
||||
@classmethod
|
||||
|
@ -895,7 +895,7 @@ class AnalysisSheetReport(Report):
|
|||
|
||||
sheet = AnalysisSheet(data.get('id'))
|
||||
if data.get('execute') or not sheet.report_cache:
|
||||
return super(AnalysisSheetReport, cls).execute(ids, data)
|
||||
return super().execute(ids, data)
|
||||
return (sheet.report_format, sheet.report_cache, False, sheet.number)
|
||||
|
||||
@classmethod
|
||||
|
@ -909,8 +909,7 @@ class AnalysisSheetReport(Report):
|
|||
Field = pool.get('lims.interface.table.field')
|
||||
Data = pool.get('lims.interface.data')
|
||||
|
||||
report_context = super(AnalysisSheetReport,
|
||||
cls).get_context(records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
sheet = AnalysisSheet(data.get('id'))
|
||||
print_expression_column = data.get('print_expression_column')
|
||||
|
|
|
@ -14,7 +14,7 @@ class Move(metaclass=PoolMeta):
|
|||
__name__ = 'stock.move'
|
||||
|
||||
def _get_account_stock_move_lines(self, type_):
|
||||
move_line, = super(Move, self)._get_account_stock_move_lines(type_)
|
||||
move_line, = super()._get_account_stock_move_lines(type_)
|
||||
|
||||
if not move_line.account.type.expense:
|
||||
return [move_line]
|
||||
|
|
|
@ -106,7 +106,7 @@ class LabDeviceMaintenance(Workflow, ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(LabDeviceMaintenance, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('date', 'DESC'))
|
||||
cls._transitions |= set((
|
||||
('draft', 'pending'),
|
||||
|
@ -140,7 +140,7 @@ class LabDeviceMaintenance(Workflow, ModelSQL, ModelView):
|
|||
@classmethod
|
||||
def delete(cls, maintenances):
|
||||
cls.check_delete(maintenances)
|
||||
super(LabDeviceMaintenance, cls).delete(maintenances)
|
||||
super().delete(maintenances)
|
||||
|
||||
@classmethod
|
||||
def check_delete(cls, maintenances):
|
||||
|
|
|
@ -13,7 +13,7 @@ class AdministrativeTaskTemplate(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def get_types(cls):
|
||||
types = super(AdministrativeTaskTemplate, cls).get_types()
|
||||
types = super().get_types()
|
||||
types.append(('device_maintenance',
|
||||
gettext('lims_device_maintenance.lbl_device_maintenance')))
|
||||
return types
|
||||
|
@ -24,6 +24,6 @@ class AdministrativeTask(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def _get_origin(cls):
|
||||
origins = super(AdministrativeTask, cls)._get_origin()
|
||||
origins = super()._get_origin()
|
||||
origins.append('lims.lab.device.maintenance')
|
||||
return origins
|
||||
|
|
|
@ -12,6 +12,6 @@ class NotebookRule(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def _target_fields(cls):
|
||||
field_list = super(NotebookRule, cls)._target_fields()
|
||||
field_list = super()._target_fields()
|
||||
field_list.append('diagnosis_warning')
|
||||
return field_list
|
||||
|
|
|
@ -85,7 +85,7 @@ class NotebookLine(metaclass=PoolMeta):
|
|||
@classmethod
|
||||
def write(cls, *args):
|
||||
TaskTemplate = Pool().get('lims.administrative.task.template')
|
||||
super(NotebookLine, cls).write(*args)
|
||||
super().write(*args)
|
||||
actions = iter(args)
|
||||
for lines, vals in zip(actions, actions):
|
||||
if 'accepted' in vals and vals['accepted']:
|
||||
|
@ -125,8 +125,7 @@ class NotebookLineRepeatAnalysis(metaclass=PoolMeta):
|
|||
__name__ = 'lims.notebook.line.repeat_analysis'
|
||||
|
||||
def _get_repetition_defaults(self, line):
|
||||
defaults = super(NotebookLineRepeatAnalysis,
|
||||
self)._get_repetition_defaults(line)
|
||||
defaults = super()._get_repetition_defaults(line)
|
||||
defaults['notify_acceptance'] = self.start.notify_acceptance
|
||||
if self.start.notify_acceptance:
|
||||
defaults['notify_acceptance_user'] = Transaction().user
|
||||
|
|
|
@ -28,7 +28,7 @@ class ResultsReportVersionDetail(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ResultsReportVersionDetail, cls).__setup__()
|
||||
super().__setup__()
|
||||
diagnosed_state = ('diagnosed', 'Diagnosed')
|
||||
if diagnosed_state not in cls.state.selection:
|
||||
cls.state.selection.append(diagnosed_state)
|
||||
|
@ -48,7 +48,7 @@ class ResultsReportVersionDetail(metaclass=PoolMeta):
|
|||
@fields.depends('template', '_parent_template.diagnosis_template',
|
||||
methods=['on_change_diagnosis_template'])
|
||||
def on_change_template(self):
|
||||
super(ResultsReportVersionDetail, self).on_change_template()
|
||||
super().on_change_template()
|
||||
if self.template and self.template.diagnosis_template:
|
||||
self.diagnosis_template = self.template.diagnosis_template
|
||||
self.on_change_diagnosis_template()
|
||||
|
@ -70,8 +70,7 @@ class ResultsReportVersionDetail(metaclass=PoolMeta):
|
|||
@classmethod
|
||||
def _get_fields_from_samples(cls, samples):
|
||||
Notebook = Pool().get('lims.notebook')
|
||||
detail_default = super(ResultsReportVersionDetail,
|
||||
cls)._get_fields_from_samples(samples)
|
||||
detail_default = super()._get_fields_from_samples(samples)
|
||||
for sample in samples:
|
||||
notebook = Notebook(sample['notebook'])
|
||||
diagnostician = notebook.fraction.sample.diagnostician
|
||||
|
@ -85,8 +84,7 @@ class ResultsReportVersionDetail(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def _get_fields_from_detail(cls, detail):
|
||||
detail_default = super(ResultsReportVersionDetail,
|
||||
cls)._get_fields_from_detail(detail)
|
||||
detail_default = super()._get_fields_from_detail(detail)
|
||||
if detail.diagnostician:
|
||||
detail_default['diagnostician'] = detail.diagnostician.id
|
||||
if detail.diagnosis_template:
|
||||
|
@ -110,7 +108,7 @@ class ResultsReportVersionDetailSample(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def create(cls, vlist):
|
||||
samples = super(ResultsReportVersionDetailSample, cls).create(vlist)
|
||||
samples = super().create(vlist)
|
||||
for sample in samples:
|
||||
template = sample.version_detail.template
|
||||
if not template or not template.diagnosis_template:
|
||||
|
@ -142,8 +140,7 @@ class ResultsReportVersionDetailSample(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def _get_fields_from_sample(cls, sample):
|
||||
sample_default = super(ResultsReportVersionDetailSample,
|
||||
cls)._get_fields_from_sample(sample)
|
||||
sample_default = super()._get_fields_from_sample(sample)
|
||||
sample_default['diagnosis'] = sample.diagnosis
|
||||
sample_default['diagnosis_states'] = sample.diagnosis_states
|
||||
return sample_default
|
||||
|
|
|
@ -15,7 +15,7 @@ class Sample(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def create(cls, vlist):
|
||||
samples = super(Sample, cls).create(vlist)
|
||||
samples = super().create(vlist)
|
||||
for sample in samples:
|
||||
if not sample.diagnostician:
|
||||
sample.diagnostician = cls.get_default_diagnostician(sample)
|
||||
|
@ -52,8 +52,7 @@ class CreateSample(metaclass=PoolMeta):
|
|||
__name__ = 'lims.create_sample'
|
||||
|
||||
def _get_samples_defaults(self, entry_id):
|
||||
samples_defaults = super(CreateSample,
|
||||
self)._get_samples_defaults(entry_id)
|
||||
samples_defaults = super()._get_samples_defaults(entry_id)
|
||||
|
||||
diagnostician_id = None
|
||||
if (hasattr(self.start, 'diagnostician') and
|
||||
|
|
|
@ -13,7 +13,7 @@ class AdministrativeTaskTemplate(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def get_types(cls):
|
||||
types = super(AdministrativeTaskTemplate, cls).get_types()
|
||||
types = super().get_types()
|
||||
types.append(('line_acceptance',
|
||||
gettext('lims_diagnosis.lbl_line_acceptance')))
|
||||
return types
|
||||
|
@ -24,6 +24,6 @@ class AdministrativeTask(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def _get_origin(cls):
|
||||
origins = super(AdministrativeTask, cls)._get_origin()
|
||||
origins = super()._get_origin()
|
||||
origins.append('lims.notebook.line')
|
||||
return origins
|
||||
|
|
|
@ -43,14 +43,14 @@ class ResultsReportVersionDetail(metaclass=PoolMeta):
|
|||
@classmethod
|
||||
@ModelView.button
|
||||
def release(cls, details):
|
||||
super(ResultsReportVersionDetail, cls).release(details)
|
||||
super().release(details)
|
||||
for detail in details:
|
||||
detail.unsign()
|
||||
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
def release_all_lang(cls, details):
|
||||
super(ResultsReportVersionDetail, cls).release_all_lang(details)
|
||||
super().release_all_lang(details)
|
||||
for detail in details:
|
||||
detail.unsign()
|
||||
|
||||
|
@ -65,7 +65,7 @@ class ResultsReport(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def _get_modified_fields(cls):
|
||||
fields = super(ResultsReport, cls)._get_modified_fields()
|
||||
fields = super()._get_modified_fields()
|
||||
fields.extend([
|
||||
'signed',
|
||||
'signed_date',
|
||||
|
@ -386,7 +386,7 @@ class ResultsReportAnnulation(metaclass=PoolMeta):
|
|||
|
||||
def transition_annul(self):
|
||||
logger.info('transition_annul():INIT')
|
||||
super(ResultsReportAnnulation, self).transition_annul()
|
||||
super().transition_annul()
|
||||
logger.info('transition_annul():INHERIT')
|
||||
|
||||
ResultsDetail = Pool().get('lims.results_report.version.detail')
|
||||
|
|
|
@ -12,7 +12,7 @@ class TrendChart(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(TrendChart, cls).__setup__()
|
||||
super().__setup__()
|
||||
filter = ('component', 'Same Component')
|
||||
if filter not in cls.filter.selection:
|
||||
cls.filter.selection.append(filter)
|
||||
|
@ -27,7 +27,7 @@ class OpenTrendChart(metaclass=PoolMeta):
|
|||
def _get_clause(self):
|
||||
chart = self.start.chart
|
||||
notebook = self.start.notebook
|
||||
clause = super(OpenTrendChart, self)._get_clause()
|
||||
clause = super()._get_clause()
|
||||
|
||||
if chart.filter == 'component':
|
||||
clause.append(('component', '=', notebook.component))
|
||||
|
@ -40,10 +40,10 @@ class OpenTrendChart(metaclass=PoolMeta):
|
|||
chart = self.start.chart
|
||||
if chart.x_axis == 'hours_component':
|
||||
return [('hours_component', 'DESC')]
|
||||
return super(OpenTrendChart, self)._get_order()
|
||||
return super()._get_order()
|
||||
|
||||
def _get_x_axis(self, notebook):
|
||||
chart = self.start.chart
|
||||
if chart.x_axis == 'hours_component':
|
||||
return notebook.hours_component
|
||||
return super(OpenTrendChart, self)._get_x_axis(notebook)
|
||||
return super()._get_x_axis(notebook)
|
||||
|
|
|
@ -41,7 +41,7 @@ class Plant(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Plant, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('party', 'ASC'))
|
||||
cls._order.insert(1, ('name', 'ASC'))
|
||||
t = cls.__table__()
|
||||
|
@ -69,7 +69,7 @@ class Plant(ModelSQL, ModelView):
|
|||
for plant in plants:
|
||||
default['name'] = plant.name + ' (copy)'
|
||||
default['equipments'] = None
|
||||
new_plant, = super(Plant, cls).copy([plant], default)
|
||||
new_plant, = super().copy([plant], default)
|
||||
new_plants.append(new_plant)
|
||||
return new_plants
|
||||
|
||||
|
@ -82,7 +82,7 @@ class EquipmentType(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(EquipmentType, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints = [
|
||||
('name_unique', Unique(t, t.name),
|
||||
|
@ -98,7 +98,7 @@ class Brand(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Brand, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints = [
|
||||
('name_unique', Unique(t, t.name),
|
||||
|
@ -116,7 +116,7 @@ class ComponentType(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ComponentType, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints = [
|
||||
('name_unique', Unique(t, t.name),
|
||||
|
@ -138,7 +138,7 @@ class EquipmentTemplate(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(EquipmentTemplate, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('type', 'ASC'))
|
||||
cls._order.insert(1, ('brand', 'ASC'))
|
||||
cls._order.insert(2, ('model', 'ASC'))
|
||||
|
@ -209,7 +209,7 @@ class Equipment(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Equipment, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('template', 'ASC'))
|
||||
cls._order.insert(1, ('name', 'ASC'))
|
||||
t = cls.__table__()
|
||||
|
@ -221,7 +221,7 @@ class Equipment(ModelSQL, ModelView):
|
|||
@classmethod
|
||||
def create(cls, vlist):
|
||||
TaskTemplate = Pool().get('lims.administrative.task.template')
|
||||
equipments = super(Equipment, cls).create(vlist)
|
||||
equipments = super().create(vlist)
|
||||
TaskTemplate.create_tasks('equipment_missing_data',
|
||||
cls._for_task_missing_data(equipments))
|
||||
return equipments
|
||||
|
@ -320,7 +320,7 @@ class Equipment(ModelSQL, ModelView):
|
|||
new_equipments = []
|
||||
for equipment in equipments:
|
||||
default['name'] = equipment.name + ' (copy)'
|
||||
new_equipment, = super(Equipment, cls).copy([equipment], default)
|
||||
new_equipment, = super().copy([equipment], default)
|
||||
new_equipments.append(new_equipment)
|
||||
return new_equipments
|
||||
|
||||
|
@ -353,7 +353,7 @@ class Component(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Component, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('equipment', 'ASC'))
|
||||
cls._order.insert(1, ('type', 'ASC'))
|
||||
t = cls.__table__()
|
||||
|
@ -365,7 +365,7 @@ class Component(ModelSQL, ModelView):
|
|||
@classmethod
|
||||
def create(cls, vlist):
|
||||
TaskTemplate = Pool().get('lims.administrative.task.template')
|
||||
components = super(Component, cls).create(vlist)
|
||||
components = super().create(vlist)
|
||||
TaskTemplate.create_tasks('component_missing_data',
|
||||
cls._for_task_missing_data(components))
|
||||
return components
|
||||
|
|
|
@ -30,7 +30,7 @@ class Party(metaclass=PoolMeta):
|
|||
@classmethod
|
||||
def create(cls, vlist):
|
||||
TaskTemplate = Pool().get('lims.administrative.task.template')
|
||||
parties = super(Party, cls).create(vlist)
|
||||
parties = super().create(vlist)
|
||||
TaskTemplate.create_tasks('party_incomplete_file',
|
||||
cls._for_task_incomplete_file(parties))
|
||||
return parties
|
||||
|
@ -53,13 +53,13 @@ class Party(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def search_rec_name(cls, name, clause):
|
||||
res = super(Party, cls).search_rec_name(name, clause)
|
||||
res = super().search_rec_name(name, clause)
|
||||
res.append(('fantasy_name',) + tuple(clause[1:]))
|
||||
return res
|
||||
|
||||
@classmethod
|
||||
def validate(cls, parties):
|
||||
super(Party, cls).validate(parties)
|
||||
super().validate(parties)
|
||||
cls.check_complete_file(parties)
|
||||
|
||||
@classmethod
|
||||
|
|
|
@ -110,8 +110,7 @@ class ResultsReportVersionDetailSample(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def _get_fields_from_sample(cls, sample):
|
||||
sample_default = super(ResultsReportVersionDetailSample,
|
||||
cls)._get_fields_from_sample(sample)
|
||||
sample_default = super()._get_fields_from_sample(sample)
|
||||
sample_default['precedent1'] = (sample.precedent1 and
|
||||
sample.precedent1 or None)
|
||||
sample_default['precedent2'] = (sample.precedent2 and
|
||||
|
@ -122,7 +121,7 @@ class ResultsReportVersionDetailSample(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def create(cls, vlist):
|
||||
samples = super(ResultsReportVersionDetailSample, cls).create(vlist)
|
||||
samples = super().create(vlist)
|
||||
for sample in samples:
|
||||
if not sample.precedent1:
|
||||
precedents = cls.get_default_precedents(sample)
|
||||
|
|
|
@ -18,7 +18,7 @@ class Entry(metaclass=PoolMeta):
|
|||
@classmethod
|
||||
def confirm(cls, entries):
|
||||
Sample = Pool().get('lims.sample')
|
||||
super(Entry, cls).confirm(entries)
|
||||
super().confirm(entries)
|
||||
samples = [s for e in entries for s in e.samples]
|
||||
Sample._confirm_samples(samples)
|
||||
|
||||
|
@ -61,7 +61,7 @@ class Sample(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Sample, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls.product_type.states['readonly'] = Bool(Eval('component'))
|
||||
if 'component' not in cls.product_type.depends:
|
||||
cls.product_type.depends.append('component')
|
||||
|
@ -226,7 +226,7 @@ class CreateSampleStart(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(CreateSampleStart, cls).__setup__()
|
||||
super().__setup__()
|
||||
for field in ('component', 'comercial_product'):
|
||||
cls.analysis_domain.on_change_with.add(field)
|
||||
cls.product_type.states['readonly'] = Bool(Eval('component'))
|
||||
|
@ -300,7 +300,7 @@ class CreateSample(metaclass=PoolMeta):
|
|||
create_continue = StateTransition()
|
||||
|
||||
def default_start(self, fields):
|
||||
defaults = super(CreateSample, self).default_start(fields)
|
||||
defaults = super().default_start(fields)
|
||||
for field in ('storage_location', 'equipment'):
|
||||
if (hasattr(self.start, field) and getattr(self.start, field)):
|
||||
defaults[field] = getattr(self.start, field).id
|
||||
|
@ -310,8 +310,7 @@ class CreateSample(metaclass=PoolMeta):
|
|||
return defaults
|
||||
|
||||
def _get_samples_defaults(self, entry_id):
|
||||
samples_defaults = super(CreateSample,
|
||||
self)._get_samples_defaults(entry_id)
|
||||
samples_defaults = super()._get_samples_defaults(entry_id)
|
||||
|
||||
equipment_id = None
|
||||
if (hasattr(self.start, 'equipment') and
|
||||
|
|
|
@ -13,7 +13,7 @@ class AdministrativeTaskTemplate(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def get_types(cls):
|
||||
types = super(AdministrativeTaskTemplate, cls).get_types()
|
||||
types = super().get_types()
|
||||
types.append(('equipment_missing_data',
|
||||
gettext('lims_industry.lbl_equipment_missing_data')))
|
||||
types.append(('component_missing_data',
|
||||
|
@ -32,7 +32,7 @@ class AdministrativeTask(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def _get_origin(cls):
|
||||
origins = super(AdministrativeTask, cls)._get_origin()
|
||||
origins = super()._get_origin()
|
||||
origins.extend([
|
||||
'lims.equipment',
|
||||
'lims.component',
|
||||
|
|
|
@ -53,7 +53,7 @@ class ResultsImport(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ResultsImport, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('name_uniq', Unique(t, t.name),
|
||||
|
|
|
@ -18,7 +18,7 @@ class ResultsImport(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ResultsImport, cls).__setup__()
|
||||
super().__setup__()
|
||||
controllers = [
|
||||
('custom_set_csv', 'Custom Set - CSV'),
|
||||
('custom_set_xls', 'Custom Set - XLS'),
|
||||
|
@ -33,7 +33,7 @@ class ResultsImport(metaclass=PoolMeta):
|
|||
elif self.name == 'custom_set_xls':
|
||||
self.controller = custom_set_xls
|
||||
else:
|
||||
return super(ResultsImport, self).loadController()
|
||||
return super().loadController()
|
||||
|
||||
def getAnalysisCode(self, row):
|
||||
return self.controller.getAnalysisCode(self, row)
|
||||
|
|
|
@ -14,7 +14,7 @@ class ResultsImport(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ResultsImport, cls).__setup__()
|
||||
super().__setup__()
|
||||
controllers = [
|
||||
('generic_form_xls', 'Generic Form - XLS'),
|
||||
]
|
||||
|
@ -26,4 +26,4 @@ class ResultsImport(metaclass=PoolMeta):
|
|||
if self.name == 'generic_form_xls':
|
||||
self.controller = generic_form_xls
|
||||
else:
|
||||
return super(ResultsImport, self).loadController()
|
||||
return super().loadController()
|
||||
|
|
|
@ -14,7 +14,7 @@ class ResultsImport(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ResultsImport, cls).__setup__()
|
||||
super().__setup__()
|
||||
controllers = [
|
||||
('generic_service_xls', 'Generic Service Form - XLS'),
|
||||
]
|
||||
|
@ -26,4 +26,4 @@ class ResultsImport(metaclass=PoolMeta):
|
|||
if self.name == 'generic_service_xls':
|
||||
self.controller = generic_service_xls
|
||||
else:
|
||||
return super(ResultsImport, self).loadController()
|
||||
return super().loadController()
|
||||
|
|
|
@ -164,8 +164,7 @@ class ModelAccess(metaclass=PoolMeta):
|
|||
if model_name in ('lims.interface.data',
|
||||
'lims.interface.grouped_data'):
|
||||
return True
|
||||
return super(ModelAccess, cls).check_relation(model_name, field_name,
|
||||
mode)
|
||||
return super().check_relation(model_name, field_name, mode)
|
||||
|
||||
|
||||
class Data(ModelSQL, ModelView):
|
||||
|
@ -179,13 +178,13 @@ class Data(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Data, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls.__rpc__['fields_view_get'].cache = None
|
||||
cls.__rpc__['default_get'].cache = None
|
||||
|
||||
@classmethod
|
||||
def __post_setup__(cls):
|
||||
super(Data, cls).__post_setup__()
|
||||
super().__post_setup__()
|
||||
cls._previous_fields = cls._fields
|
||||
cls._fields = Adapter()
|
||||
|
||||
|
@ -199,14 +198,14 @@ class Data(ModelSQL, ModelView):
|
|||
kwargs_copy = kwargs.copy()
|
||||
for kw in kwargs_copy:
|
||||
kwargs.pop(kw, None)
|
||||
super(Data, self).__init__(id, **kwargs)
|
||||
super().__init__(id, **kwargs)
|
||||
self._values = {}
|
||||
for kw in kwargs_copy:
|
||||
self._values[kw] = kwargs_copy[kw]
|
||||
|
||||
def __getattr__(self, name):
|
||||
try:
|
||||
return super(Data, self).__getattr__(name)
|
||||
return super().__getattr__(name)
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
|
@ -270,7 +269,7 @@ class Data(ModelSQL, ModelView):
|
|||
@classmethod
|
||||
def fields_get(cls, fields_names=None):
|
||||
Model = Pool().get('ir.model')
|
||||
res = super(Data, cls).fields_get(fields_names)
|
||||
res = super().fields_get(fields_names)
|
||||
|
||||
table = cls.get_table()
|
||||
readonly = Transaction().context.get('lims_interface_readonly', False)
|
||||
|
@ -341,8 +340,7 @@ class Data(ModelSQL, ModelView):
|
|||
del cache[cls.__name__]
|
||||
|
||||
if not cls.get_table():
|
||||
return super(Data, cls).search(domain, offset, limit, order, count,
|
||||
query)
|
||||
return super().search(domain, offset, limit, order, count, query)
|
||||
|
||||
# Get domain clauses
|
||||
sql_table = cls.get_sql_table()
|
||||
|
@ -616,7 +614,7 @@ class Data(ModelSQL, ModelView):
|
|||
table = cls.get_table()
|
||||
if table:
|
||||
return Table(table.name)
|
||||
return super(Data, cls).__table__()
|
||||
return super().__table__()
|
||||
|
||||
|
||||
class GroupedData(ModelView):
|
||||
|
@ -629,13 +627,13 @@ class GroupedData(ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(GroupedData, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls.__rpc__['fields_view_get'].cache = None
|
||||
cls.__rpc__['default_get'].cache = None
|
||||
|
||||
@classmethod
|
||||
def __post_setup__(cls):
|
||||
super(GroupedData, cls).__post_setup__()
|
||||
super().__post_setup__()
|
||||
cls._previous_fields = cls._fields
|
||||
cls._fields = GroupedAdapter()
|
||||
|
||||
|
@ -643,14 +641,14 @@ class GroupedData(ModelView):
|
|||
kwargs_copy = kwargs.copy()
|
||||
for kw in kwargs_copy:
|
||||
kwargs.pop(kw, None)
|
||||
super(GroupedData, self).__init__(id, **kwargs)
|
||||
super().__init__(id, **kwargs)
|
||||
self._values = {}
|
||||
for kw in kwargs_copy:
|
||||
self._values[kw] = kwargs_copy[kw]
|
||||
|
||||
def __getattr__(self, name):
|
||||
try:
|
||||
return super(GroupedData, self).__getattr__(name)
|
||||
return super().__getattr__(name)
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
|
@ -714,7 +712,7 @@ class GroupedData(ModelView):
|
|||
@classmethod
|
||||
def fields_get(cls, fields_names=None):
|
||||
Model = Pool().get('ir.model')
|
||||
res = super(GroupedData, cls).fields_get(fields_names)
|
||||
res = super().fields_get(fields_names)
|
||||
|
||||
table = cls.get_table()
|
||||
readonly = Transaction().context.get('lims_interface_readonly', False)
|
||||
|
|
|
@ -241,7 +241,7 @@ class Interface(Workflow, ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Interface, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._transitions |= set((
|
||||
('draft', 'active'),
|
||||
('active', 'canceled'),
|
||||
|
@ -724,7 +724,7 @@ class Column(sequence_ordered(), ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Column, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('interface_alias_uniq',
|
||||
|
@ -961,7 +961,7 @@ class Compilation(Workflow, ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Compilation, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('date_time', 'DESC'))
|
||||
cls._transitions |= set((
|
||||
('draft', 'active'),
|
||||
|
@ -1414,7 +1414,7 @@ class Compilation(Workflow, ModelSQL, ModelView):
|
|||
with Transaction().set_context(lims_interface_table=c.table):
|
||||
lines = Data.search([('compilation', '=', c.id)])
|
||||
Data.delete(lines)
|
||||
super(Compilation, cls).delete(compilations)
|
||||
super().delete(compilations)
|
||||
|
||||
|
||||
class CompilationOrigin(ModelSQL, ModelView):
|
||||
|
@ -1435,7 +1435,7 @@ class CompilationOrigin(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def validate(cls, origins):
|
||||
super(CompilationOrigin, cls).validate(origins)
|
||||
super().validate(origins)
|
||||
for origin in origins:
|
||||
origin.check_duplicated()
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ class Table(ModelSQL, ModelView):
|
|||
def delete(cls, tables):
|
||||
for table in tables:
|
||||
table.drop_table()
|
||||
super(Table, cls).delete(tables)
|
||||
super().delete(tables)
|
||||
|
||||
|
||||
class TableField(ModelSQL, ModelView):
|
||||
|
|
|
@ -13,5 +13,5 @@ class Entry(metaclass=PoolMeta):
|
|||
@classmethod
|
||||
def confirm(cls, entries):
|
||||
Planification = Pool().get('lims.planification')
|
||||
super(Entry, cls).confirm(entries)
|
||||
super().confirm(entries)
|
||||
Planification.automatic_plan(entries=entries)
|
||||
|
|
|
@ -13,5 +13,5 @@ class QualityTest(metaclass=PoolMeta):
|
|||
@classmethod
|
||||
def confirm(cls, tests):
|
||||
Planification = Pool().get('lims.planification')
|
||||
super(QualityTest, cls).confirm(tests)
|
||||
super().confirm(tests)
|
||||
Planification.automatic_plan(tests=tests)
|
||||
|
|
|
@ -28,7 +28,7 @@ class ProductionConfiguration(metaclass=PoolMeta):
|
|||
pool = Pool()
|
||||
if field == 'lot_sequence':
|
||||
return pool.get('production.configuration.lot_sequence')
|
||||
return super(ProductionConfiguration, cls).multivalue_model(field)
|
||||
return super().multivalue_model(field)
|
||||
|
||||
@classmethod
|
||||
def default_lot_sequence(cls, **pattern):
|
||||
|
|
|
@ -78,7 +78,7 @@ class Production(metaclass=PoolMeta):
|
|||
Template = pool.get('product.template')
|
||||
Product = pool.get('product.product')
|
||||
|
||||
super(Production, self).explode_bom()
|
||||
super().explode_bom()
|
||||
if not (self.bom and self.product and self.uom):
|
||||
return
|
||||
|
||||
|
@ -126,7 +126,7 @@ class Production(metaclass=PoolMeta):
|
|||
@classmethod
|
||||
def run(cls, productions):
|
||||
cls.update_inputs_origin(productions)
|
||||
super(Production, cls).run(productions)
|
||||
super().run(productions)
|
||||
|
||||
@classmethod
|
||||
def update_inputs_origin(cls, productions):
|
||||
|
@ -140,7 +140,7 @@ class Production(metaclass=PoolMeta):
|
|||
cls.update_outputs_origin(productions)
|
||||
cls.update_outputs_costs(productions)
|
||||
cls.create_lot(productions)
|
||||
super(Production, cls).done(productions)
|
||||
super().done(productions)
|
||||
|
||||
@classmethod
|
||||
def update_outputs_origin(cls, productions):
|
||||
|
@ -222,8 +222,8 @@ class Production(metaclass=PoolMeta):
|
|||
to_location = product_location
|
||||
else:
|
||||
from_location = product_location
|
||||
return super(Production, self)._explode_move_values(from_location,
|
||||
to_location, company, bom_io, quantity)
|
||||
return super()._explode_move_values(from_location, to_location,
|
||||
company, bom_io, quantity)
|
||||
|
||||
|
||||
class FamilyEquivalentReport(Report):
|
||||
|
@ -235,8 +235,7 @@ class FamilyEquivalentReport(Report):
|
|||
pool = Pool()
|
||||
Company = pool.get('company.company')
|
||||
|
||||
report_context = super(FamilyEquivalentReport, cls).get_context(
|
||||
records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
report_context['company'] = Company(Transaction().context['company'])
|
||||
report_context['records'] = cls._get_family_records(records)
|
||||
|
|
|
@ -50,7 +50,7 @@ class FamilyEquivalent(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def validate(cls, family_equivalents):
|
||||
super(FamilyEquivalent, cls).validate(family_equivalents)
|
||||
super().validate(family_equivalents)
|
||||
for fe in family_equivalents:
|
||||
fe.check_products()
|
||||
|
||||
|
@ -68,8 +68,7 @@ class FamilyEquivalent(ModelSQL, ModelView):
|
|||
default = {}
|
||||
current_default = default.copy()
|
||||
current_default['products'] = None
|
||||
return super(FamilyEquivalent, cls).copy(family_equivalents,
|
||||
default=current_default)
|
||||
return super().copy(family_equivalents, default=current_default)
|
||||
|
||||
|
||||
class Template(metaclass=PoolMeta):
|
||||
|
@ -101,7 +100,7 @@ class Template(metaclass=PoolMeta):
|
|||
if products:
|
||||
return [('id', 'in', list(map(int, [product.template.id
|
||||
for product in products])))]
|
||||
return super(Template, cls).search_rec_name(name, clause)
|
||||
return super().search_rec_name(name, clause)
|
||||
|
||||
|
||||
class Product(metaclass=PoolMeta):
|
||||
|
@ -137,7 +136,7 @@ class Product(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def search_rec_name(cls, name, clause):
|
||||
res = super(Product, cls).search_rec_name(name, clause)
|
||||
res = super().search_rec_name(name, clause)
|
||||
return ['OR',
|
||||
res,
|
||||
[('barcode', ) + tuple(clause[1:])]
|
||||
|
@ -252,7 +251,7 @@ class LotCategory(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(LotCategory, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('name', 'ASC'))
|
||||
|
||||
|
||||
|
@ -345,7 +344,7 @@ class Lot(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Lot, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls.expiration_date.states['invisible'] = Eval(False)
|
||||
|
||||
@staticmethod
|
||||
|
@ -443,7 +442,7 @@ class Lot(metaclass=PoolMeta):
|
|||
config.lot_category_prod_domestic_use else None)
|
||||
if lot_category_id:
|
||||
values['category'] = lot_category_id
|
||||
return super(Lot, cls).create(vlist)
|
||||
return super().create(vlist)
|
||||
|
||||
@classmethod
|
||||
def search_account_category(cls, name, clause):
|
||||
|
@ -467,7 +466,7 @@ class Move(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def _get_origin(cls):
|
||||
models = super(Move, cls)._get_origin()
|
||||
models = super()._get_origin()
|
||||
models.append('production')
|
||||
return models
|
||||
|
||||
|
@ -528,12 +527,12 @@ class ShipmentIn(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ShipmentIn, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls.inventory_moves.states['readonly'] = Eval('state').in_(
|
||||
['draft', 'cancel'])
|
||||
|
||||
def _get_inventory_move(self, incoming_move):
|
||||
move = super(ShipmentIn, self)._get_inventory_move(incoming_move)
|
||||
move = super()._get_inventory_move(incoming_move)
|
||||
if not move:
|
||||
return None
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ class Project(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Project, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('code_uniq', Unique(t, t.code),
|
||||
|
@ -72,7 +72,7 @@ class Entry(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Entry, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls.samples.context.update({
|
||||
'project': Eval('project', None),
|
||||
})
|
||||
|
@ -120,7 +120,7 @@ class CreateSample(metaclass=PoolMeta):
|
|||
def default_start(self, fields):
|
||||
Entry = Pool().get('lims.entry')
|
||||
|
||||
defaults = super(CreateSample, self).default_start(fields)
|
||||
defaults = super().default_start(fields)
|
||||
defaults['project_type'] = ''
|
||||
|
||||
entry = Entry(Transaction().context['active_id'])
|
||||
|
|
|
@ -27,14 +27,14 @@ class Project(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Project, cls).__setup__()
|
||||
super().__setup__()
|
||||
project_type = ('itl', 'Interlaboratory')
|
||||
if project_type not in cls.type.selection:
|
||||
cls.type.selection.append(project_type)
|
||||
|
||||
@classmethod
|
||||
def view_attributes(cls):
|
||||
return super(Project, cls).view_attributes() + [
|
||||
return super().view_attributes() + [
|
||||
('//group[@id="itl"]', 'states', {
|
||||
'invisible': Not(Bool(Equal(Eval('type'), 'itl'))),
|
||||
})]
|
||||
|
@ -45,7 +45,7 @@ class Entry(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Entry, cls).__setup__()
|
||||
super().__setup__()
|
||||
project_type = ('itl', 'Interlaboratory')
|
||||
if project_type not in cls.project_type.selection:
|
||||
cls.project_type.selection.append(project_type)
|
||||
|
|
|
@ -27,7 +27,7 @@ class Configuration(metaclass=PoolMeta):
|
|||
pool = Pool()
|
||||
if field == 'sample_in_custody_sequence':
|
||||
return pool.get('lims.configuration.sequence')
|
||||
return super(Configuration, cls).multivalue_model(field)
|
||||
return super().multivalue_model(field)
|
||||
|
||||
@classmethod
|
||||
def default_sample_in_custody_sequence(cls, **pattern):
|
||||
|
@ -71,7 +71,7 @@ class LabWorkYear(metaclass=PoolMeta):
|
|||
pool = Pool()
|
||||
if field == 'project_study_plan_sequence':
|
||||
return pool.get('lims.lab.workyear.sequence')
|
||||
return super(LabWorkYear, cls).multivalue_model(field)
|
||||
return super().multivalue_model(field)
|
||||
|
||||
|
||||
class LabWorkYearSequence(metaclass=PoolMeta):
|
||||
|
|
|
@ -173,7 +173,7 @@ class Project(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Project, cls).__setup__()
|
||||
super().__setup__()
|
||||
project_type = ('study_plan', 'Study plan')
|
||||
if project_type not in cls.type.selection:
|
||||
cls.type.selection.append(project_type)
|
||||
|
@ -228,7 +228,7 @@ class Project(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def view_attributes(cls):
|
||||
return super(Project, cls).view_attributes() + [
|
||||
return super().view_attributes() + [
|
||||
('//group[@id="study_plan"]', 'states', {
|
||||
'invisible': Not(Bool(Equal(Eval('type'), 'study_plan'))),
|
||||
})]
|
||||
|
@ -253,7 +253,7 @@ class Project(metaclass=PoolMeta):
|
|||
values['stp_number'] = Sequence.get_id(sequence.id)
|
||||
if values['stp_phase'] == 'study_plan':
|
||||
values['code'] = values['stp_number']
|
||||
return super(Project, cls).create(vlist)
|
||||
return super().create(vlist)
|
||||
|
||||
@fields.depends('description')
|
||||
def on_change_with_stp_title(self, name=None):
|
||||
|
@ -375,7 +375,7 @@ class Entry(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Entry, cls).__setup__()
|
||||
super().__setup__()
|
||||
project_type = ('study_plan', 'Study plan')
|
||||
if project_type not in cls.project_type.selection:
|
||||
cls.project_type.selection.append(project_type)
|
||||
|
@ -399,7 +399,7 @@ class ProjectLaboratoryProfessional(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def validate(cls, professionals):
|
||||
super(ProjectLaboratoryProfessional, cls).validate(professionals)
|
||||
super().validate(professionals)
|
||||
for p in professionals:
|
||||
p.check_roles()
|
||||
|
||||
|
@ -459,7 +459,7 @@ class ProjectProfessionalPosition(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ProjectProfessionalPosition, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('code_uniq', Unique(t, t.code),
|
||||
|
@ -648,7 +648,7 @@ class ProjectSampleInCustody(ModelSQL, ModelView):
|
|||
for values in vlist:
|
||||
values['sample'] = Sequence.get_id(
|
||||
config.sample_in_custody_sequence.id)
|
||||
return super(ProjectSampleInCustody, cls).create(vlist)
|
||||
return super().create(vlist)
|
||||
|
||||
|
||||
class ProjectDeviationAndAmendment(ModelSQL, ModelView):
|
||||
|
@ -685,7 +685,7 @@ class ProjectDeviationAndAmendment(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ProjectDeviationAndAmendment, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('type', 'ASC'))
|
||||
cls._order.insert(1, ('document_type', 'ASC'))
|
||||
cls._order.insert(2, ('number', 'ASC'))
|
||||
|
@ -700,7 +700,7 @@ class ProjectDeviationAndAmendment(ModelSQL, ModelView):
|
|||
count[key] = 0
|
||||
count[key] += 1
|
||||
values['number'] = cls.get_next_number(key, count[key])
|
||||
return super(ProjectDeviationAndAmendment, cls).create(vlist)
|
||||
return super().create(vlist)
|
||||
|
||||
@classmethod
|
||||
def get_next_number(cls, key, count):
|
||||
|
@ -807,7 +807,7 @@ class Sample(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def view_attributes(cls):
|
||||
return super(Sample, cls).view_attributes() + [
|
||||
return super().view_attributes() + [
|
||||
('//page[@id="study_plan"]', 'states', {
|
||||
'invisible': Not(Bool(Equal(
|
||||
Eval('project_type'), 'study_plan'))),
|
||||
|
@ -841,7 +841,7 @@ class CreateSampleStart(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def view_attributes(cls):
|
||||
return super(CreateSampleStart, cls).view_attributes() + [
|
||||
return super().view_attributes() + [
|
||||
('//page[@id="study_plan"]', 'states', {
|
||||
'invisible': Not(Bool(Equal(
|
||||
Eval('project_type'), 'study_plan'))),
|
||||
|
@ -852,8 +852,7 @@ class CreateSample(metaclass=PoolMeta):
|
|||
__name__ = 'lims.create_sample'
|
||||
|
||||
def _get_samples_defaults(self, entry_id):
|
||||
samples_defaults = super(CreateSample,
|
||||
self)._get_samples_defaults(entry_id)
|
||||
samples_defaults = super()._get_samples_defaults(entry_id)
|
||||
|
||||
application_date = (hasattr(self.start, 'application_date') and
|
||||
getattr(self.start, 'application_date') or None)
|
||||
|
@ -951,14 +950,14 @@ class ProjectGLPReport01(Report):
|
|||
if project.type != 'study_plan':
|
||||
raise UserError(gettext('lims_project_study_plan.msg_not_glp'))
|
||||
|
||||
return super(ProjectGLPReport01, cls).execute(ids, data)
|
||||
return super().execute(ids, data)
|
||||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
ProjectSampleInCustody = Pool().get(
|
||||
'lims.project.sample_in_custody')
|
||||
|
||||
report_context = super(ProjectGLPReport01, cls).get_context(
|
||||
report_context = super().get_context(
|
||||
records, data)
|
||||
|
||||
report_context['company'] = report_context['user'].company
|
||||
|
@ -1014,13 +1013,13 @@ class ProjectGLPReport02(Report):
|
|||
if project.type != 'study_plan':
|
||||
raise UserError(gettext('lims_project_study_plan.msg_not_glp'))
|
||||
|
||||
return super(ProjectGLPReport02, cls).execute(ids, data)
|
||||
return super().execute(ids, data)
|
||||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
Fraction = Pool().get('lims.fraction')
|
||||
|
||||
report_context = super(ProjectGLPReport02, cls).get_context(
|
||||
report_context = super().get_context(
|
||||
records, data)
|
||||
|
||||
report_context['company'] = report_context['user'].company
|
||||
|
@ -1112,7 +1111,7 @@ class ProjectGLPReport03(Report):
|
|||
if project.type != 'study_plan':
|
||||
raise UserError(gettext('lims_project_study_plan.msg_not_glp'))
|
||||
|
||||
return super(ProjectGLPReport03, cls).execute(ids, data)
|
||||
return super().execute(ids, data)
|
||||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
|
@ -1120,7 +1119,7 @@ class ProjectGLPReport03(Report):
|
|||
Project = pool.get('lims.project')
|
||||
Fraction = pool.get('lims.fraction')
|
||||
|
||||
report_context = super(ProjectGLPReport03, cls).get_context(
|
||||
report_context = super().get_context(
|
||||
records, data)
|
||||
|
||||
project = Project(data['id'])
|
||||
|
@ -1173,7 +1172,7 @@ class ProjectGLPReport04(Report):
|
|||
if project.type != 'study_plan':
|
||||
raise UserError(gettext('lims_project_study_plan.msg_not_glp'))
|
||||
|
||||
return super(ProjectGLPReport04, cls).execute(ids, data)
|
||||
return super().execute(ids, data)
|
||||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
|
@ -1181,8 +1180,7 @@ class ProjectGLPReport04(Report):
|
|||
Fraction = pool.get('lims.fraction')
|
||||
Move = pool.get('stock.move')
|
||||
|
||||
report_context = super(ProjectGLPReport04, cls).get_context(
|
||||
records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
report_context['company'] = report_context['user'].company
|
||||
report_context['stp_number'] = records[0].stp_number
|
||||
|
@ -1276,7 +1274,7 @@ class ProjectGLPReport05(Report):
|
|||
if project.type != 'study_plan':
|
||||
raise UserError(gettext('lims_project_study_plan.msg_not_glp'))
|
||||
|
||||
return super(ProjectGLPReport05, cls).execute(ids, data)
|
||||
return super().execute(ids, data)
|
||||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
|
@ -1284,8 +1282,7 @@ class ProjectGLPReport05(Report):
|
|||
Project = pool.get('lims.project')
|
||||
Fraction = pool.get('lims.fraction')
|
||||
|
||||
report_context = super(ProjectGLPReport05, cls).get_context(
|
||||
records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
project = Project(data['id'])
|
||||
|
||||
|
@ -1335,7 +1332,7 @@ class ProjectGLPReport06(Report):
|
|||
if project.type != 'study_plan':
|
||||
raise UserError(gettext('lims_project_study_plan.msg_not_glp'))
|
||||
|
||||
return super(ProjectGLPReport06, cls).execute(ids, data)
|
||||
return super().execute(ids, data)
|
||||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
|
@ -1345,8 +1342,7 @@ class ProjectGLPReport06(Report):
|
|||
ProjectDevAndAmndmntProfessional = pool.get(
|
||||
'lims.project.deviation_amendment.professional')
|
||||
|
||||
report_context = super(ProjectGLPReport06, cls).get_context(
|
||||
records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
report_context['company'] = report_context['user'].company
|
||||
report_context['stp_number'] = records[0].stp_number
|
||||
|
@ -1416,7 +1412,7 @@ class ProjectGLPReport07(Report):
|
|||
if project.type != 'study_plan':
|
||||
raise UserError(gettext('lims_project_study_plan.msg_not_glp'))
|
||||
|
||||
return super(ProjectGLPReport07, cls).execute(ids, data)
|
||||
return super().execute(ids, data)
|
||||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
|
@ -1424,8 +1420,7 @@ class ProjectGLPReport07(Report):
|
|||
Entry = pool.get('lims.entry')
|
||||
Fraction = pool.get('lims.fraction')
|
||||
|
||||
report_context = super(ProjectGLPReport07, cls).get_context(
|
||||
records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
report_context['company'] = report_context['user'].company
|
||||
report_context['stp_number'] = records[0].stp_number
|
||||
|
@ -1481,7 +1476,7 @@ class ProjectGLPReport08(Report):
|
|||
if project.type != 'study_plan':
|
||||
raise UserError(gettext('lims_project_study_plan.msg_not_glp'))
|
||||
|
||||
return super(ProjectGLPReport08, cls).execute(ids, data)
|
||||
return super().execute(ids, data)
|
||||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
|
@ -1489,8 +1484,7 @@ class ProjectGLPReport08(Report):
|
|||
Entry = pool.get('lims.entry')
|
||||
Fraction = pool.get('lims.fraction')
|
||||
|
||||
report_context = super(ProjectGLPReport08, cls).get_context(
|
||||
records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
report_context['company'] = report_context['user'].company
|
||||
report_context['stp_number'] = records[0].stp_number
|
||||
|
@ -1543,7 +1537,7 @@ class ProjectGLPReport09(Report):
|
|||
if project.type != 'study_plan':
|
||||
raise UserError(gettext('lims_project_study_plan.msg_not_glp'))
|
||||
|
||||
return super(ProjectGLPReport09, cls).execute(ids, data)
|
||||
return super().execute(ids, data)
|
||||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
|
@ -1555,8 +1549,7 @@ class ProjectGLPReport09(Report):
|
|||
ResultsReport = pool.get('lims.results_report')
|
||||
Analysis = pool.get('lims.analysis')
|
||||
|
||||
report_context = super(ProjectGLPReport09, cls).get_context(
|
||||
records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
report_context['company'] = report_context['user'].company
|
||||
report_context['stp_number'] = records[0].stp_number
|
||||
|
@ -1689,8 +1682,7 @@ class ProjectGLPReport10(Report):
|
|||
pool = Pool()
|
||||
Project = pool.get('lims.project')
|
||||
|
||||
report_context = super(ProjectGLPReport10, cls).get_context(
|
||||
records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
report_context['company'] = report_context['user'].company
|
||||
report_context['date_from'] = data['date_from']
|
||||
|
@ -1834,15 +1826,14 @@ class ProjectGLPReport11(Report):
|
|||
if project.type != 'study_plan':
|
||||
raise UserError(gettext('lims_project_study_plan.msg_not_glp'))
|
||||
|
||||
return super(ProjectGLPReport11, cls).execute(ids, data)
|
||||
return super().execute(ids, data)
|
||||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
ProjectReferenceElement = Pool().get(
|
||||
'lims.project.reference_element')
|
||||
|
||||
report_context = super(ProjectGLPReport11, cls).get_context(
|
||||
records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
report_context['company'] = report_context['user'].company
|
||||
report_context['stp_number'] = records[0].stp_number
|
||||
|
@ -1916,8 +1907,7 @@ class ProjectGLPReport12(Report):
|
|||
pool = Pool()
|
||||
ProjectChangeLog = pool.get('lims.project.stp_changelog')
|
||||
|
||||
report_context = super(ProjectGLPReport12, cls).get_context(
|
||||
records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
report_context['company'] = report_context['user'].company
|
||||
report_context['date_from'] = data['date_from']
|
||||
|
@ -1992,12 +1982,11 @@ class ProjectGLPReportStudyPlan(Report):
|
|||
if project.type != 'study_plan':
|
||||
raise UserError(gettext('lims_project_study_plan.msg_not_glp'))
|
||||
|
||||
return super(ProjectGLPReportStudyPlan, cls).execute(ids, data)
|
||||
return super().execute(ids, data)
|
||||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
report_context = super(ProjectGLPReportStudyPlan, cls).get_context(
|
||||
records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
project = records[0]
|
||||
|
||||
|
@ -2087,12 +2076,11 @@ class ProjectGLPReportFinalRP(Report):
|
|||
if project.stp_phase != 'study_plan':
|
||||
raise UserError(gettext(
|
||||
'lims_project_study_plan.msg_not_study_plan'))
|
||||
return super(ProjectGLPReportFinalRP, cls).execute(ids, data)
|
||||
return super().execute(ids, data)
|
||||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
report_context = super(ProjectGLPReportFinalRP, cls).get_context(
|
||||
records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
project = records[0]
|
||||
|
||||
|
@ -2328,12 +2316,11 @@ class ProjectGLPReportFinalFOR(Report):
|
|||
if project.stp_phase != 'study_plan':
|
||||
raise UserError(gettext(
|
||||
'lims_project_study_plan.msg_not_study_plan'))
|
||||
return super(ProjectGLPReportFinalFOR, cls).execute(ids, data)
|
||||
return super().execute(ids, data)
|
||||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
report_context = super(ProjectGLPReportFinalFOR, cls).get_context(
|
||||
records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
project = records[0]
|
||||
|
||||
|
@ -2574,13 +2561,11 @@ class ProjectGLPReportAnalyticalPhase(Report):
|
|||
if project.stp_phase != 'analytical_phase':
|
||||
raise UserError(gettext(
|
||||
'lims_project_study_plan.msg_not_analytical_phase'))
|
||||
return super(ProjectGLPReportAnalyticalPhase,
|
||||
cls).execute(ids, data)
|
||||
return super().execute(ids, data)
|
||||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
report_context = super(ProjectGLPReportAnalyticalPhase,
|
||||
cls).get_context(records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
project = records[0]
|
||||
|
||||
|
@ -2813,15 +2798,14 @@ class ProjectGLPReport13(Report):
|
|||
if project.type != 'study_plan':
|
||||
raise UserError(gettext('lims_project_study_plan.msg_not_glp'))
|
||||
|
||||
return super(ProjectGLPReport13, cls).execute(ids, data)
|
||||
return super().execute(ids, data)
|
||||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
pool = Pool()
|
||||
Fraction = pool.get('lims.fraction')
|
||||
|
||||
report_context = super(ProjectGLPReport13, cls).get_context(
|
||||
records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
report_context['company'] = report_context['user'].company
|
||||
report_context['stp_matrix'] = records[0].stp_matrix_client_description
|
||||
|
|
|
@ -26,7 +26,7 @@ class LabWorkYear(metaclass=PoolMeta):
|
|||
pool = Pool()
|
||||
if field == 'project_tas_sequence':
|
||||
return pool.get('lims.lab.workyear.sequence')
|
||||
return super(LabWorkYear, cls).multivalue_model(field)
|
||||
return super().multivalue_model(field)
|
||||
|
||||
|
||||
class LabWorkYearSequence(metaclass=PoolMeta):
|
||||
|
|
|
@ -39,7 +39,7 @@ class Project(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Project, cls).__setup__()
|
||||
super().__setup__()
|
||||
project_type = ('tas', 'TAS')
|
||||
if project_type not in cls.type.selection:
|
||||
cls.type.selection.append(project_type)
|
||||
|
@ -48,7 +48,7 @@ class Project(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def view_attributes(cls):
|
||||
return super(Project, cls).view_attributes() + [
|
||||
return super().view_attributes() + [
|
||||
('//group[@id="tas"]', 'states', {
|
||||
'invisible': Not(Bool(Equal(Eval('type'), 'tas'))),
|
||||
})]
|
||||
|
@ -120,7 +120,7 @@ class Project(metaclass=PoolMeta):
|
|||
for values in vlist:
|
||||
if values['type'] == 'tas':
|
||||
values['code'] = Sequence.get_id(sequence.id)
|
||||
return super(Project, cls).create(vlist)
|
||||
return super().create(vlist)
|
||||
|
||||
|
||||
class Entry(metaclass=PoolMeta):
|
||||
|
@ -128,7 +128,7 @@ class Entry(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Entry, cls).__setup__()
|
||||
super().__setup__()
|
||||
project_type = ('tas', 'TAS')
|
||||
if project_type not in cls.project_type.selection:
|
||||
cls.project_type.selection.append(project_type)
|
||||
|
@ -143,7 +143,7 @@ class TasType(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(TasType, cls).__setup__()
|
||||
super().__setup__()
|
||||
t = cls.__table__()
|
||||
cls._sql_constraints += [
|
||||
('code_uniq', Unique(t, t.code),
|
||||
|
|
|
@ -21,14 +21,14 @@ class Project(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Project, cls).__setup__()
|
||||
super().__setup__()
|
||||
project_type = ('water', 'Water sampling')
|
||||
if project_type not in cls.type.selection:
|
||||
cls.type.selection.append(project_type)
|
||||
|
||||
@classmethod
|
||||
def view_attributes(cls):
|
||||
return super(Project, cls).view_attributes() + [
|
||||
return super().view_attributes() + [
|
||||
('//group[@id="water"]', 'states', {
|
||||
'invisible': Not(Bool(Equal(Eval('type'), 'water'))),
|
||||
})]
|
||||
|
@ -39,7 +39,7 @@ class Entry(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Entry, cls).__setup__()
|
||||
super().__setup__()
|
||||
project_type = ('water', 'Water sampling')
|
||||
if project_type not in cls.project_type.selection:
|
||||
cls.project_type.selection.append(project_type)
|
||||
|
@ -64,7 +64,7 @@ class Sample(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def view_attributes(cls):
|
||||
return super(Sample, cls).view_attributes() + [
|
||||
return super().view_attributes() + [
|
||||
('//page[@id="water_sampling"]', 'states', {
|
||||
'invisible': Not(Bool(
|
||||
Equal(Eval('project_type'), 'water'))),
|
||||
|
@ -90,7 +90,7 @@ class CreateSampleStart(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def view_attributes(cls):
|
||||
return super(CreateSampleStart, cls).view_attributes() + [
|
||||
return super().view_attributes() + [
|
||||
('//page[@id="water_sampling"]', 'states', {
|
||||
'invisible': Not(Bool(
|
||||
Equal(Eval('project_type'), 'water'))),
|
||||
|
@ -101,8 +101,7 @@ class CreateSample(metaclass=PoolMeta):
|
|||
__name__ = 'lims.create_sample'
|
||||
|
||||
def _get_samples_defaults(self, entry_id):
|
||||
samples_defaults = super(CreateSample,
|
||||
self)._get_samples_defaults(entry_id)
|
||||
samples_defaults = super()._get_samples_defaults(entry_id)
|
||||
|
||||
sampling_point = (hasattr(self.start, 'sampling_point') and
|
||||
getattr(self.start, 'sampling_point') or None)
|
||||
|
@ -134,7 +133,7 @@ class ProjectWaterSampling(Report):
|
|||
if project.type != 'water':
|
||||
raise UserError(gettext('lims_project_water.msg_not_water'))
|
||||
|
||||
return super(ProjectWaterSampling, cls).execute(ids, data)
|
||||
return super().execute(ids, data)
|
||||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
|
@ -142,8 +141,7 @@ class ProjectWaterSampling(Report):
|
|||
Project = pool.get('lims.project')
|
||||
Fraction = pool.get('lims.fraction')
|
||||
Entry = pool.get('lims.entry')
|
||||
report_context = super(ProjectWaterSampling, cls).get_context(
|
||||
records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
project = Project(data['id'])
|
||||
entry = Entry.search([
|
||||
|
|
|
@ -88,12 +88,12 @@ class Typification(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Typification, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._sql_constraints = []
|
||||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
super(Typification, cls).__register__(module_name)
|
||||
super().__register__(module_name)
|
||||
table = cls.__table_handler__(module_name)
|
||||
|
||||
table.drop_constraint('product_matrix_analysis_method_uniq')
|
||||
|
@ -160,7 +160,7 @@ class Typification(metaclass=PoolMeta):
|
|||
template, = Template.browse([values.get('quality_template')])
|
||||
values['product_type'] = template.product.product_type.id
|
||||
values['matrix'] = template.product.matrix.id
|
||||
return super(Typification, cls).create(vlist)
|
||||
return super().create(vlist)
|
||||
|
||||
|
||||
class NotebookLine(metaclass=PoolMeta):
|
||||
|
@ -232,8 +232,7 @@ class NotebookLine(metaclass=PoolMeta):
|
|||
Config = pool.get('lims.configuration')
|
||||
UiView = pool.get('ir.ui.view')
|
||||
|
||||
result = super(NotebookLine, cls).fields_view_get(view_id=view_id,
|
||||
view_type=view_type)
|
||||
result = super().fields_view_get(view_id=view_id, view_type=view_type)
|
||||
|
||||
# All Notebook Lines view
|
||||
if view_id and UiView(view_id).name == 'notebook_line_all_list':
|
||||
|
@ -441,8 +440,8 @@ class ResultReport(metaclass=PoolMeta):
|
|||
@classmethod
|
||||
def get_reference(cls, range_type, notebook_line, language,
|
||||
report_section):
|
||||
res = super(ResultReport, cls).get_reference(
|
||||
range_type, notebook_line, language, report_section)
|
||||
res = super().get_reference(range_type, notebook_line, language,
|
||||
report_section)
|
||||
if res:
|
||||
return res
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ class Template(Workflow, ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Template, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._transitions |= set((
|
||||
('draft', 'active'),
|
||||
('active', 'draft'),
|
||||
|
@ -122,7 +122,7 @@ class Template(Workflow, ModelSQL, ModelView):
|
|||
if 'lines' not in default:
|
||||
default['lines'] = None
|
||||
default['revision'] = 1
|
||||
return super(Template, cls).copy(templates, default)
|
||||
return super().copy(templates, default)
|
||||
|
||||
@classmethod
|
||||
def check_delete(cls, templates):
|
||||
|
@ -135,7 +135,7 @@ class Template(Workflow, ModelSQL, ModelView):
|
|||
@classmethod
|
||||
def delete(cls, templates):
|
||||
cls.check_delete(templates)
|
||||
super(Template, cls).delete(templates)
|
||||
super().delete(templates)
|
||||
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
|
@ -221,7 +221,7 @@ class QualityTest(Workflow, ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(QualityTest, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('number', 'DESC'))
|
||||
cls._transitions |= set((
|
||||
('draft', 'confirmed'),
|
||||
|
@ -295,7 +295,7 @@ class QualityTest(Workflow, ModelSQL, ModelView):
|
|||
@classmethod
|
||||
def delete(cls, tests):
|
||||
cls.check_delete(tests)
|
||||
super(QualityTest, cls).delete(tests)
|
||||
super().delete(tests)
|
||||
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
|
@ -393,7 +393,7 @@ class QualityTest(Workflow, ModelSQL, ModelView):
|
|||
default = {}
|
||||
if 'templates' not in default:
|
||||
default['templates'] = None
|
||||
return super(QualityTest, cls).copy(tests, default)
|
||||
return super().copy(tests, default)
|
||||
|
||||
|
||||
class CreateQualityTestStart(ModelView):
|
||||
|
@ -600,7 +600,7 @@ class TestReport(CompanyReport):
|
|||
def get_context(cls, records, data):
|
||||
Test = Pool().get('lims.quality.test')
|
||||
|
||||
report_context = super(TestReport, cls).get_context(records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
|
||||
report_context['objects'] = Test.browse(data['ids'])
|
||||
report_context['get_professionals'] = cls.get_professionals
|
||||
|
|
|
@ -329,7 +329,7 @@ class SampleLabels(Report):
|
|||
|
||||
@classmethod
|
||||
def get_context(cls, records, data):
|
||||
report_context = super(SampleLabels, cls).get_context(records, data)
|
||||
report_context = super().get_context(records, data)
|
||||
labels = []
|
||||
for sample in records:
|
||||
for fraction in sample.fractions:
|
||||
|
|
|
@ -12,7 +12,7 @@ class ActionReport(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ActionReport, cls).__setup__()
|
||||
super().__setup__()
|
||||
results_option = ('results', 'Results Report')
|
||||
if results_option not in cls.template_extension.selection:
|
||||
cls.template_extension.selection.append(results_option)
|
||||
|
|
|
@ -63,7 +63,7 @@ class ReportTemplate(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def view_attributes(cls):
|
||||
return super(ReportTemplate, cls).view_attributes() + [
|
||||
return super().view_attributes() + [
|
||||
('//page[@id="header_footer"]', 'states', {
|
||||
'invisible': Eval('type') != 'base',
|
||||
}),
|
||||
|
@ -151,19 +151,19 @@ class ReportTemplateTranslation(ModelSQL, ModelView):
|
|||
def create(cls, vlist):
|
||||
Template = Pool().get('lims.result_report.template')
|
||||
Template._translation_cache.clear()
|
||||
return super(ReportTemplateTranslation, cls).create(vlist)
|
||||
return super().create(vlist)
|
||||
|
||||
@classmethod
|
||||
def write(cls, *args):
|
||||
Template = Pool().get('lims.result_report.template')
|
||||
Template._translation_cache.clear()
|
||||
return super(ReportTemplateTranslation, cls).write(*args)
|
||||
return super().write(*args)
|
||||
|
||||
@classmethod
|
||||
def delete(cls, translations):
|
||||
Template = Pool().get('lims.result_report.template')
|
||||
Template._translation_cache.clear()
|
||||
return super(ReportTemplateTranslation, cls).delete(translations)
|
||||
return super().delete(translations)
|
||||
|
||||
|
||||
class ReportTemplateSection(ModelSQL, ModelView):
|
||||
|
@ -185,12 +185,12 @@ class ReportTemplateSection(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ReportTemplateSection, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('order', 'ASC'))
|
||||
|
||||
@classmethod
|
||||
def validate(cls, sections):
|
||||
super(ReportTemplateSection, cls).validate(sections)
|
||||
super().validate(sections)
|
||||
merger = PdfFileMerger(strict=False)
|
||||
for section in sections:
|
||||
filedata = BytesIO(section.data)
|
||||
|
|
|
@ -49,7 +49,7 @@ class ResultsReportVersionDetail(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ResultsReportVersionDetail, cls).__setup__()
|
||||
super().__setup__()
|
||||
if 'invisible' in cls.resultrange_origin.states:
|
||||
del cls.resultrange_origin.states['invisible']
|
||||
if 'required' in cls.resultrange_origin.states:
|
||||
|
@ -98,8 +98,7 @@ class ResultsReportVersionDetail(metaclass=PoolMeta):
|
|||
@classmethod
|
||||
def _get_fields_from_samples(cls, samples):
|
||||
Notebook = Pool().get('lims.notebook')
|
||||
detail_default = super(ResultsReportVersionDetail,
|
||||
cls)._get_fields_from_samples(samples)
|
||||
detail_default = super()._get_fields_from_samples(samples)
|
||||
for sample in samples:
|
||||
notebook = Notebook(sample['notebook'])
|
||||
result_template = notebook.fraction.sample.result_template
|
||||
|
@ -127,8 +126,7 @@ class ResultsReportVersionDetail(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def _get_fields_from_detail(cls, detail):
|
||||
detail_default = super(ResultsReportVersionDetail,
|
||||
cls)._get_fields_from_detail(detail)
|
||||
detail_default = super()._get_fields_from_detail(detail)
|
||||
if detail.template:
|
||||
detail_default['template'] = detail.template.id
|
||||
if detail.trend_charts:
|
||||
|
@ -167,12 +165,12 @@ class ResultsReportVersionDetailSection(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ResultsReportVersionDetailSection, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('order', 'ASC'))
|
||||
|
||||
@classmethod
|
||||
def validate(cls, sections):
|
||||
super(ResultsReportVersionDetailSection, cls).validate(sections)
|
||||
super().validate(sections)
|
||||
merger = PdfFileMerger(strict=False)
|
||||
for section in sections:
|
||||
filedata = BytesIO(section.data)
|
||||
|
|
|
@ -30,8 +30,7 @@ class CreateSample(metaclass=PoolMeta):
|
|||
__name__ = 'lims.create_sample'
|
||||
|
||||
def _get_samples_defaults(self, entry_id):
|
||||
samples_defaults = super(CreateSample,
|
||||
self)._get_samples_defaults(entry_id)
|
||||
samples_defaults = super()._get_samples_defaults(entry_id)
|
||||
|
||||
result_template_id = None
|
||||
if (hasattr(self.start, 'result_template') and
|
||||
|
|
|
@ -12,6 +12,6 @@ class NotebookRule(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def _target_fields(cls):
|
||||
field_list = super(NotebookRule, cls)._target_fields()
|
||||
field_list = super()._target_fields()
|
||||
field_list.append('result_warning')
|
||||
return field_list
|
||||
|
|
|
@ -16,7 +16,7 @@ class NotebookLine(metaclass=PoolMeta):
|
|||
@classmethod
|
||||
def write(cls, *args):
|
||||
TaskTemplate = Pool().get('lims.administrative.task.template')
|
||||
super(NotebookLine, cls).write(*args)
|
||||
super().write(*args)
|
||||
actions = iter(args)
|
||||
for lines, vals in zip(actions, actions):
|
||||
if vals.get('result_warning', False):
|
||||
|
|
|
@ -13,7 +13,7 @@ class AdministrativeTaskTemplate(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def get_types(cls):
|
||||
types = super(AdministrativeTaskTemplate, cls).get_types()
|
||||
types = super().get_types()
|
||||
types.append(('result_warning',
|
||||
gettext('lims_result_warning.lbl_result_warning')))
|
||||
return types
|
||||
|
@ -24,6 +24,6 @@ class AdministrativeTask(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def _get_origin(cls):
|
||||
origins = super(AdministrativeTask, cls)._get_origin()
|
||||
origins = super()._get_origin()
|
||||
origins.append('lims.notebook.line')
|
||||
return origins
|
||||
|
|
|
@ -69,7 +69,7 @@ class OpenResultsDetailAttachment(metaclass=PoolMeta):
|
|||
__name__ = 'lims.results_report.version.detail.open_attachment'
|
||||
|
||||
def get_resource(self, details):
|
||||
res = super(OpenResultsDetailAttachment, self).get_resource(details)
|
||||
res = super().get_resource(details)
|
||||
for detail in details:
|
||||
for s in detail.samples:
|
||||
if s.notebook.fraction.sample.sale_lines:
|
||||
|
|
|
@ -48,7 +48,7 @@ class Sale(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Sale, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls.invoice_address.domain = [('party', '=', Eval('invoice_party'))]
|
||||
cls.invoice_address.depends.append('invoice_party')
|
||||
cls._buttons.update({
|
||||
|
@ -62,7 +62,7 @@ class Sale(metaclass=PoolMeta):
|
|||
|
||||
@fields.depends('party', 'invoice_party')
|
||||
def on_change_party(self):
|
||||
super(Sale, self).on_change_party()
|
||||
super().on_change_party()
|
||||
self.invoice_party = None
|
||||
if self.party:
|
||||
invoice_party_domain = self.on_change_with_invoice_party_domain()
|
||||
|
@ -102,7 +102,7 @@ class Sale(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def quote(cls, sales):
|
||||
super(Sale, cls).quote(sales)
|
||||
super().quote(sales)
|
||||
cls.send_email_party(s for s in sales if s.send_email)
|
||||
|
||||
@classmethod
|
||||
|
|
|
@ -46,8 +46,7 @@ class CreateSampleStart(metaclass=PoolMeta):
|
|||
|
||||
@fields.depends('product_type', 'matrix', 'sale_lines')
|
||||
def on_change_with_analysis_domain(self, name=None):
|
||||
analysis_domain = super(CreateSampleStart,
|
||||
self).on_change_with_analysis_domain(name)
|
||||
analysis_domain = super().on_change_with_analysis_domain(name)
|
||||
|
||||
if not self.sale_lines:
|
||||
return analysis_domain
|
||||
|
@ -64,8 +63,7 @@ class CreateSample(metaclass=PoolMeta):
|
|||
__name__ = 'lims.create_sample'
|
||||
|
||||
def _get_samples_defaults(self, entry_id):
|
||||
samples_defaults = super(CreateSample,
|
||||
self)._get_samples_defaults(entry_id)
|
||||
samples_defaults = super()._get_samples_defaults(entry_id)
|
||||
|
||||
if (not hasattr(self.start, 'sale_lines') or
|
||||
not hasattr(self.start, 'services')):
|
||||
|
@ -105,7 +103,7 @@ class Service(metaclass=PoolMeta):
|
|||
__name__ = 'lims.service'
|
||||
|
||||
def get_invoice_line(self, invoice_type):
|
||||
invoice_line = super(Service, self).get_invoice_line(invoice_type)
|
||||
invoice_line = super().get_invoice_line(invoice_type)
|
||||
if self.sample.sale_lines:
|
||||
for sale_line in self.sample.sale_lines:
|
||||
if sale_line.product.id == self.analysis.product.id:
|
||||
|
|
|
@ -25,7 +25,7 @@ class Configuration(metaclass=PoolMeta):
|
|||
pool = Pool()
|
||||
if field == 'sample_label_sequence':
|
||||
return pool.get('sale.configuration.sequence')
|
||||
return super(Configuration, cls).multivalue_model(field)
|
||||
return super().multivalue_model(field)
|
||||
|
||||
@classmethod
|
||||
def default_sample_label_sequence(cls, **pattern):
|
||||
|
|
|
@ -51,7 +51,7 @@ class Sale(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Sale, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls.invoice_address.domain = [('party', '=', Eval('invoice_party'))]
|
||||
cls.invoice_address.depends.append('invoice_party')
|
||||
cls.lines.depends.extend(['plants', 'equipments', 'components'])
|
||||
|
@ -82,7 +82,7 @@ class Sale(metaclass=PoolMeta):
|
|||
pool = Pool()
|
||||
TaskTemplate = pool.get('lims.administrative.task.template')
|
||||
SaleLine = pool.get('sale.line')
|
||||
super(Sale, cls).confirm(sales)
|
||||
super().confirm(sales)
|
||||
TaskTemplate.create_tasks('sale_purchase_order_required',
|
||||
cls._for_task_purchase_order_required(sales))
|
||||
lines = [l for s in sales for l in s.lines]
|
||||
|
@ -211,7 +211,7 @@ class SaleLine(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(SaleLine, cls).__setup__()
|
||||
super().__setup__()
|
||||
cls.expiration_date.states['required'] = And(
|
||||
Bool(Eval('_parent_sale', {}).get('lubrication_plan', False)),
|
||||
Bool(Eval('analysis')))
|
||||
|
|
|
@ -13,7 +13,7 @@ class AdministrativeTaskTemplate(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def get_types(cls):
|
||||
types = super(AdministrativeTaskTemplate, cls).get_types()
|
||||
types = super().get_types()
|
||||
types.append(('sale_purchase_order_required',
|
||||
gettext('lims_sale_industry.lbl_sale_purchase_order_required')))
|
||||
types.append(('product_quotation',
|
||||
|
@ -26,7 +26,7 @@ class AdministrativeTask(metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def _get_origin(cls):
|
||||
origins = super(AdministrativeTask, cls)._get_origin()
|
||||
origins = super()._get_origin()
|
||||
origins.extend([
|
||||
'sale.sale',
|
||||
'sale.line',
|
||||
|
|
Loading…
Reference in New Issue