lims_analysis_sheet: add planning date and activation date and user
This commit is contained in:
parent
4b581bb05e
commit
c936cceda2
|
@ -2,6 +2,14 @@
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||||
|
|
||||||
|
msgctxt "field:lims.analysis_sheet,activated_by:"
|
||||||
|
msgid "Activated By"
|
||||||
|
msgstr "Activada por"
|
||||||
|
|
||||||
|
msgctxt "field:lims.analysis_sheet,activated_date:"
|
||||||
|
msgid "Activated Date"
|
||||||
|
msgstr "Fecha Activación"
|
||||||
|
|
||||||
msgctxt "field:lims.analysis_sheet,compilation:"
|
msgctxt "field:lims.analysis_sheet,compilation:"
|
||||||
msgid "Compilation"
|
msgid "Compilation"
|
||||||
msgstr "Compilación"
|
msgstr "Compilación"
|
||||||
|
@ -42,6 +50,10 @@ msgctxt "field:lims.analysis_sheet,planification:"
|
||||||
msgid "Planification"
|
msgid "Planification"
|
||||||
msgstr "Planificación"
|
msgstr "Planificación"
|
||||||
|
|
||||||
|
msgctxt "field:lims.analysis_sheet,planning_date:"
|
||||||
|
msgid "Planning Date"
|
||||||
|
msgstr "Fecha Planificación"
|
||||||
|
|
||||||
msgctxt "field:lims.analysis_sheet,professional:"
|
msgctxt "field:lims.analysis_sheet,professional:"
|
||||||
msgid "Professional"
|
msgid "Professional"
|
||||||
msgstr "Profesional"
|
msgstr "Profesional"
|
||||||
|
|
|
@ -396,6 +396,8 @@ class AnalysisSheet(Workflow, ModelSQL, ModelView):
|
||||||
], 'State', required=True, readonly=True)
|
], 'State', required=True, readonly=True)
|
||||||
planification = fields.Many2One('lims.planification', 'Planification',
|
planification = fields.Many2One('lims.planification', 'Planification',
|
||||||
readonly=True)
|
readonly=True)
|
||||||
|
planning_date = fields.Function(fields.Date('Planning Date'),
|
||||||
|
'get_planning_date', searcher='search_planning_date')
|
||||||
partial_analysys = fields.Function(fields.Boolean('Partial analysis'),
|
partial_analysys = fields.Function(fields.Boolean('Partial analysis'),
|
||||||
'get_fields')
|
'get_fields')
|
||||||
completion_percentage = fields.Function(fields.Numeric('Complete',
|
completion_percentage = fields.Function(fields.Numeric('Complete',
|
||||||
|
@ -408,6 +410,9 @@ class AnalysisSheet(Workflow, ModelSQL, ModelView):
|
||||||
file_id='report_cache_id', store_prefix='analysis_sheet')
|
file_id='report_cache_id', store_prefix='analysis_sheet')
|
||||||
report_cache_id = fields.Char('Report ID', readonly=True)
|
report_cache_id = fields.Char('Report ID', readonly=True)
|
||||||
report_format = fields.Char('Report Format', readonly=True)
|
report_format = fields.Char('Report Format', readonly=True)
|
||||||
|
activated_by = fields.Many2One('lims.laboratory.professional',
|
||||||
|
'Activated By', readonly=True)
|
||||||
|
activated_date = fields.DateTime('Activated Date', readonly=True)
|
||||||
validated_by = fields.Many2One('lims.laboratory.professional',
|
validated_by = fields.Many2One('lims.laboratory.professional',
|
||||||
'Validated By', readonly=True)
|
'Validated By', readonly=True)
|
||||||
validated_date = fields.DateTime('Validated Date', readonly=True)
|
validated_date = fields.DateTime('Validated Date', readonly=True)
|
||||||
|
@ -489,6 +494,13 @@ class AnalysisSheet(Workflow, ModelSQL, ModelView):
|
||||||
return field.convert_order('date_time', compilation_tables,
|
return field.convert_order('date_time', compilation_tables,
|
||||||
Compilation)
|
Compilation)
|
||||||
|
|
||||||
|
def get_planning_date(self, name):
|
||||||
|
return self.planification and self.planification.date or None
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def search_planning_date(cls, name, clause):
|
||||||
|
return [('planification.date',) + tuple(clause[1:])]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_fields(cls, sheets, names):
|
def get_fields(cls, sheets, names):
|
||||||
cursor = Transaction().connection.cursor()
|
cursor = Transaction().connection.cursor()
|
||||||
|
@ -649,6 +661,7 @@ class AnalysisSheet(Workflow, ModelSQL, ModelView):
|
||||||
@classmethod
|
@classmethod
|
||||||
@ModelView.button
|
@ModelView.button
|
||||||
@Workflow.transition('active')
|
@Workflow.transition('active')
|
||||||
|
@set_state_info('activated')
|
||||||
def activate(cls, sheets):
|
def activate(cls, sheets):
|
||||||
pool = Pool()
|
pool = Pool()
|
||||||
Data = pool.get('lims.interface.data')
|
Data = pool.get('lims.interface.data')
|
||||||
|
|
|
@ -24,7 +24,13 @@
|
||||||
<field name="compilation"/>
|
<field name="compilation"/>
|
||||||
<label name="planification"/>
|
<label name="planification"/>
|
||||||
<field name="planification"/>
|
<field name="planification"/>
|
||||||
|
<label name="planning_date"/>
|
||||||
|
<field name="planning_date"/>
|
||||||
<separator string="Other Info" id="other" colspan="4"/>
|
<separator string="Other Info" id="other" colspan="4"/>
|
||||||
|
<label name="activated_by"/>
|
||||||
|
<field name="activated_by"/>
|
||||||
|
<label name="activated_date"/>
|
||||||
|
<field name="activated_date"/>
|
||||||
<label name="validated_by"/>
|
<label name="validated_by"/>
|
||||||
<field name="validated_by"/>
|
<field name="validated_by"/>
|
||||||
<label name="validated_date"/>
|
<label name="validated_date"/>
|
||||||
|
|
Loading…
Reference in New Issue