mirror of
https://github.com/Kalenis/kalenislims.git
synced 2023-12-14 07:13:04 +01:00
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 ""
|
||||
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:"
|
||||
msgid "Compilation"
|
||||
msgstr "Compilación"
|
||||
|
@ -42,6 +50,10 @@ msgctxt "field:lims.analysis_sheet,planification:"
|
|||
msgid "Planification"
|
||||
msgstr "Planificación"
|
||||
|
||||
msgctxt "field:lims.analysis_sheet,planning_date:"
|
||||
msgid "Planning Date"
|
||||
msgstr "Fecha Planificación"
|
||||
|
||||
msgctxt "field:lims.analysis_sheet,professional:"
|
||||
msgid "Professional"
|
||||
msgstr "Profesional"
|
||||
|
|
|
@ -396,6 +396,8 @@ class AnalysisSheet(Workflow, ModelSQL, ModelView):
|
|||
], 'State', required=True, readonly=True)
|
||||
planification = fields.Many2One('lims.planification', 'Planification',
|
||||
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'),
|
||||
'get_fields')
|
||||
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')
|
||||
report_cache_id = fields.Char('Report ID', 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', 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,
|
||||
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
|
||||
def get_fields(cls, sheets, names):
|
||||
cursor = Transaction().connection.cursor()
|
||||
|
@ -649,6 +661,7 @@ class AnalysisSheet(Workflow, ModelSQL, ModelView):
|
|||
@classmethod
|
||||
@ModelView.button
|
||||
@Workflow.transition('active')
|
||||
@set_state_info('activated')
|
||||
def activate(cls, sheets):
|
||||
pool = Pool()
|
||||
Data = pool.get('lims.interface.data')
|
||||
|
|
|
@ -24,7 +24,13 @@
|
|||
<field name="compilation"/>
|
||||
<label name="planification"/>
|
||||
<field name="planification"/>
|
||||
<label name="planning_date"/>
|
||||
<field name="planning_date"/>
|
||||
<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"/>
|
||||
<field name="validated_by"/>
|
||||
<label name="validated_date"/>
|
||||
|
|
Loading…
Reference in a new issue