lims_interface/lims_analysis_sheet: add notebook line to grouped data
This commit is contained in:
parent
705d3e4966
commit
ef325ce513
|
@ -1087,10 +1087,11 @@ class EditGroupedData(Wizard):
|
|||
lims_interface_table=sheet.compilation.table.id):
|
||||
line = Data.search([('id', '=', line_id)])[0]
|
||||
for rep in range(1, reps):
|
||||
record = {'iteration': rep}
|
||||
record = {
|
||||
'notebook_line': line.notebook_line.id,
|
||||
'iteration': rep,
|
||||
}
|
||||
for field in grouped_fields:
|
||||
#if bool(field.formula):
|
||||
#continue
|
||||
val = getattr(line, '%s_%s' % (field.name, str(rep)))
|
||||
if field.type == 'many2one':
|
||||
record[field.name] = val and val.id or None
|
||||
|
|
|
@ -132,6 +132,10 @@ class GroupedAdapter:
|
|||
obj = fields.Integer('ID')
|
||||
obj.name = 'id'
|
||||
res['id'] = obj
|
||||
obj = fields.Many2One('lims.notebook.line', 'Notebook Line')
|
||||
obj.name = 'notebook_line'
|
||||
obj.readonly = True
|
||||
res['notebook_line'] = obj
|
||||
obj = fields.Integer('Iteration')
|
||||
obj.name = 'iteration'
|
||||
obj.readonly = True
|
||||
|
@ -554,6 +558,8 @@ class GroupedData(ModelView):
|
|||
'Grouped Data'
|
||||
__name__ = 'lims.interface.grouped_data'
|
||||
|
||||
notebook_line = fields.Many2One('lims.notebook.line', 'Notebook Line',
|
||||
readonly=True)
|
||||
iteration = fields.Integer('Iteration', readonly=True)
|
||||
|
||||
@classmethod
|
||||
|
@ -664,6 +670,7 @@ class GroupedData(ModelView):
|
|||
assert(view.id)
|
||||
|
||||
fields_names = [
|
||||
'notebook_line',
|
||||
'iteration',
|
||||
]
|
||||
for field in table.grouped_fields_:
|
||||
|
|
|
@ -250,6 +250,10 @@ msgctxt "field:lims.interface.grouped_data,iteration:"
|
|||
msgid "Iteration"
|
||||
msgstr "Iteración"
|
||||
|
||||
msgctxt "field:lims.interface.grouped_data,notebook_line:"
|
||||
msgid "Notebook Line"
|
||||
msgstr "Línea de cuaderno"
|
||||
|
||||
msgctxt "field:lims.interface.table,fields_:"
|
||||
msgid "Fields"
|
||||
msgstr "Campos"
|
||||
|
|
Loading…
Reference in New Issue