mirror of
https://github.com/Kalenis/kalenislims.git
synced 2023-12-14 07:13:04 +01:00
lims: repeat analysis: allow to choose the method
This commit is contained in:
parent
3932c2fe45
commit
ff34e051ad
|
@ -3301,6 +3301,18 @@ msgctxt "field:lims.notebook.line.repeat_analysis.start,analysis_domain:"
|
|||
msgid "Analysis domain"
|
||||
msgstr "Dominio para Análisis"
|
||||
|
||||
msgctxt "field:lims.notebook.line.repeat_analysis.start,analysis_type:"
|
||||
msgid "Type"
|
||||
msgstr "Tipo"
|
||||
|
||||
msgctxt "field:lims.notebook.line.repeat_analysis.start,method:"
|
||||
msgid "Method"
|
||||
msgstr "Método"
|
||||
|
||||
msgctxt "field:lims.notebook.line.repeat_analysis.start,method_domain:"
|
||||
msgid "Method domain"
|
||||
msgstr "Dominio para Método"
|
||||
|
||||
msgctxt "field:lims.notebook.line.repeat_analysis.start,repetition_reason:"
|
||||
msgid "Reason"
|
||||
msgstr "Motivo"
|
||||
|
@ -12746,6 +12758,18 @@ msgctxt "selection:lims.notebook.line.all_fields,result_modifier:"
|
|||
msgid "ni"
|
||||
msgstr "ni"
|
||||
|
||||
msgctxt "selection:lims.notebook.line.repeat_analysis.start,analysis_type:"
|
||||
msgid "Analysis"
|
||||
msgstr "Análisis"
|
||||
|
||||
msgctxt "selection:lims.notebook.line.repeat_analysis.start,analysis_type:"
|
||||
msgid "Group"
|
||||
msgstr "Grupo"
|
||||
|
||||
msgctxt "selection:lims.notebook.line.repeat_analysis.start,analysis_type:"
|
||||
msgid "Set"
|
||||
msgstr "Set"
|
||||
|
||||
msgctxt "selection:lims.notebook.load_results_formula.action,result_modifier:"
|
||||
msgid "<"
|
||||
msgstr "<"
|
||||
|
|
|
@ -4943,6 +4943,30 @@ class NotebookLineRepeatAnalysisStart(ModelView):
|
|||
analysis_domain = fields.One2Many('lims.analysis', None,
|
||||
'Analysis domain')
|
||||
repetition_reason = fields.Char('Reason')
|
||||
analysis_type = fields.Function(fields.Selection([
|
||||
('analysis', 'Analysis'),
|
||||
('set', 'Set'),
|
||||
('group', 'Group'),
|
||||
], 'Type', sort=False),
|
||||
'on_change_with_analysis_type')
|
||||
method = fields.Many2One('lims.lab.method', 'Method',
|
||||
domain=[('id', 'in', Eval('method_domain'))],
|
||||
states={'invisible': Eval('analysis_type') != 'analysis'},
|
||||
depends=['method_domain', 'analysis_type'])
|
||||
method_domain = fields.Function(fields.Many2Many('lims.lab.method',
|
||||
None, None, 'Method domain'),
|
||||
'on_change_with_method_domain')
|
||||
|
||||
@fields.depends('analysis')
|
||||
def on_change_with_analysis_type(self, name=None):
|
||||
return self.analysis and self.analysis.type or None
|
||||
|
||||
@fields.depends('analysis')
|
||||
def on_change_with_method_domain(self, name=None):
|
||||
methods = []
|
||||
if self.analysis and self.analysis.methods:
|
||||
methods = [m.id for m in self.analysis.methods]
|
||||
return methods
|
||||
|
||||
|
||||
class NotebookLineRepeatAnalysis(Wizard):
|
||||
|
@ -4969,6 +4993,8 @@ class NotebookLineRepeatAnalysis(Wizard):
|
|||
Analysis = pool.get('lims.analysis')
|
||||
|
||||
line_id = self._get_notebook_line_id()
|
||||
if not line_id:
|
||||
return {}
|
||||
notebook_line = NotebookLine(line_id)
|
||||
|
||||
analysis_origin = notebook_line.analysis_origin
|
||||
|
@ -5001,7 +5027,8 @@ class NotebookLineRepeatAnalysis(Wizard):
|
|||
Config = pool.get('lims.configuration')
|
||||
|
||||
analysis = self.start.analysis
|
||||
if analysis.type == 'analysis':
|
||||
analysis_type = analysis.type
|
||||
if analysis_type == 'analysis':
|
||||
analysis_to_repeat = [analysis.id]
|
||||
else:
|
||||
analysis_to_repeat = Analysis.get_included_analysis_analysis(
|
||||
|
@ -5031,6 +5058,8 @@ class NotebookLineRepeatAnalysis(Wizard):
|
|||
nline_to_repeat = nlines[0]
|
||||
|
||||
defaults = self._get_repetition_defaults(nline_to_repeat)
|
||||
if analysis_type == 'analysis' and self.start.method:
|
||||
defaults['method'] = self.start.method.id
|
||||
if rm_type:
|
||||
defaults['final_concentration'] = None
|
||||
defaults['initial_unit'] = rm_start_uom
|
||||
|
|
|
@ -4,4 +4,8 @@
|
|||
<field name="analysis"/>
|
||||
<label name="repetition_reason"/>
|
||||
<field name="repetition_reason"/>
|
||||
<label name="method"/>
|
||||
<field name="method"/>
|
||||
<field name="analysis_type" invisible="1"/>
|
||||
<field name="method_domain" invisible="1"/>
|
||||
</form>
|
||||
|
|
Loading…
Reference in a new issue