lims, lims_report_html, lims_diagnosis: results report: do not overwrite some
fields of the draft detail
This commit is contained in:
parent
edd51b3f97
commit
a141d2793b
|
@ -1168,6 +1168,11 @@ class ResultsReportVersionDetail(Workflow, ModelSQL, ModelView):
|
|||
detail_default['report_type_forced'] = 'normal'
|
||||
return detail_default
|
||||
|
||||
@classmethod
|
||||
def _get_fields_not_overwrite(cls):
|
||||
fields = ['type', 'signer', 'samples']
|
||||
return fields
|
||||
|
||||
@classmethod
|
||||
def get_samples_list(cls, details, name):
|
||||
cursor = Transaction().connection.cursor()
|
||||
|
@ -2922,9 +2927,10 @@ class GenerateReport(Wizard):
|
|||
del sample['notebook']
|
||||
ResultsSample.write(existing_sample, sample)
|
||||
|
||||
del details['type']
|
||||
del details['signer']
|
||||
del details['samples']
|
||||
# do not overwrite some fields of the draft detail
|
||||
for field in ResultsDetail._get_fields_not_overwrite():
|
||||
if field in details:
|
||||
del details[field]
|
||||
ResultsDetail.write([draft_detail], details)
|
||||
reports_details = [draft_detail.id]
|
||||
|
||||
|
|
|
@ -102,6 +102,12 @@ class ResultsReportVersionDetail(metaclass=PoolMeta):
|
|||
result_template.diagnosis_template.id)
|
||||
return detail_default
|
||||
|
||||
@classmethod
|
||||
def _get_fields_not_overwrite(cls):
|
||||
fields = super()._get_fields_not_overwrite()
|
||||
fields.extend(['diagnostician', 'diagnosis_template'])
|
||||
return fields
|
||||
|
||||
@classmethod
|
||||
def _get_fields_from_detail(cls, detail):
|
||||
detail_default = super()._get_fields_from_detail(detail)
|
||||
|
|
|
@ -172,6 +172,13 @@ class ResultsReportVersionDetail(metaclass=PoolMeta):
|
|||
result_template = None
|
||||
return result_template
|
||||
|
||||
@classmethod
|
||||
def _get_fields_not_overwrite(cls):
|
||||
fields = super()._get_fields_not_overwrite()
|
||||
fields.extend(['template', 'trend_charts', 'charts_x_row',
|
||||
'sections', 'resultrange_origin'])
|
||||
return fields
|
||||
|
||||
@classmethod
|
||||
def _get_fields_from_detail(cls, detail):
|
||||
detail_default = super()._get_fields_from_detail(detail)
|
||||
|
|
Loading…
Reference in New Issue