mirror of
https://github.com/Kalenis/kalenislims.git
synced 2023-12-14 07:13:04 +01:00
lims: results report: add 'Waiting' state
This commit is contained in:
parent
16e85474a2
commit
4e47dc4dc2
8 changed files with 144 additions and 5 deletions
|
@ -186,6 +186,7 @@ def register():
|
||||||
certification.DuplicateAnalysisFamilyStart,
|
certification.DuplicateAnalysisFamilyStart,
|
||||||
results_report.ResultsReportAnnulationStart,
|
results_report.ResultsReportAnnulationStart,
|
||||||
results_report.NewResultsReportVersionStart,
|
results_report.NewResultsReportVersionStart,
|
||||||
|
results_report.ResultsReportWaitingStart,
|
||||||
sample.CountersampleStorageStart,
|
sample.CountersampleStorageStart,
|
||||||
sample.CountersampleStorageEmpty,
|
sample.CountersampleStorageEmpty,
|
||||||
sample.CountersampleStorageResult,
|
sample.CountersampleStorageResult,
|
||||||
|
@ -351,6 +352,7 @@ def register():
|
||||||
results_report.ResultsReportRelease,
|
results_report.ResultsReportRelease,
|
||||||
results_report.ResultsReportAnnulation,
|
results_report.ResultsReportAnnulation,
|
||||||
results_report.NewResultsReportVersion,
|
results_report.NewResultsReportVersion,
|
||||||
|
results_report.ResultsReportWaiting,
|
||||||
sample.CountersampleStorage,
|
sample.CountersampleStorage,
|
||||||
sample.CountersampleStorageRevert,
|
sample.CountersampleStorageRevert,
|
||||||
sample.CountersampleDischarge,
|
sample.CountersampleDischarge,
|
||||||
|
|
|
@ -5120,6 +5120,10 @@ msgctxt "field:lims.results_report.version.detail,valid:"
|
||||||
msgid "Active"
|
msgid "Active"
|
||||||
msgstr "Activo"
|
msgstr "Activo"
|
||||||
|
|
||||||
|
msgctxt "field:lims.results_report.version.detail,waiting_reason:"
|
||||||
|
msgid "Waiting reason"
|
||||||
|
msgstr "Motivo de espera"
|
||||||
|
|
||||||
msgctxt "field:lims.results_report.version.detail,write_date2:"
|
msgctxt "field:lims.results_report.version.detail,write_date2:"
|
||||||
msgid "Write Date"
|
msgid "Write Date"
|
||||||
msgstr "Fecha de modificación"
|
msgstr "Fecha de modificación"
|
||||||
|
@ -5285,6 +5289,10 @@ msgctxt "field:lims.results_report_annulation.start,annulment_reason_print:"
|
||||||
msgid "Print annulment reason in next version"
|
msgid "Print annulment reason in next version"
|
||||||
msgstr "Imprimir motivo de anulación en próxima versión"
|
msgstr "Imprimir motivo de anulación en próxima versión"
|
||||||
|
|
||||||
|
msgctxt "field:lims.results_report_waiting.start,waiting_reason:"
|
||||||
|
msgid "Waiting reason"
|
||||||
|
msgstr "Motivo de espera"
|
||||||
|
|
||||||
msgctxt "field:lims.rule,action:"
|
msgctxt "field:lims.rule,action:"
|
||||||
msgid "Action"
|
msgid "Action"
|
||||||
msgstr "Acción"
|
msgstr "Acción"
|
||||||
|
@ -7335,6 +7343,10 @@ msgctxt "model:ir.action,name:wiz_lims_results_report_annulation"
|
||||||
msgid "Report Annulation"
|
msgid "Report Annulation"
|
||||||
msgstr "Anulación de Informe"
|
msgstr "Anulación de Informe"
|
||||||
|
|
||||||
|
msgctxt "model:ir.action,name:wiz_lims_results_report_waiting"
|
||||||
|
msgid "Report Waiting"
|
||||||
|
msgstr "Informe en espera"
|
||||||
|
|
||||||
msgctxt "model:ir.action,name:wiz_lims_sample_results_report"
|
msgctxt "model:ir.action,name:wiz_lims_sample_results_report"
|
||||||
msgid "Sample Results Reports"
|
msgid "Sample Results Reports"
|
||||||
msgstr "Informes de resultados de la Muestra"
|
msgstr "Informes de resultados de la Muestra"
|
||||||
|
@ -7550,6 +7562,11 @@ msgctxt ""
|
||||||
msgid "Revised"
|
msgid "Revised"
|
||||||
msgstr "Revisado"
|
msgstr "Revisado"
|
||||||
|
|
||||||
|
msgctxt ""
|
||||||
|
"model:ir.action.act_window.domain,name:act_lims_results_report_version_detail_domain_waiting"
|
||||||
|
msgid "Waiting"
|
||||||
|
msgstr "En espera"
|
||||||
|
|
||||||
msgctxt ""
|
msgctxt ""
|
||||||
"model:ir.action.act_window.domain,name:act_lims_samples_pending_reporting_domain_complete"
|
"model:ir.action.act_window.domain,name:act_lims_samples_pending_reporting_domain_complete"
|
||||||
msgid "Complete"
|
msgid "Complete"
|
||||||
|
@ -9718,6 +9735,10 @@ msgctxt "model:lims.results_report_annulation.start,name:"
|
||||||
msgid "Report Annulation"
|
msgid "Report Annulation"
|
||||||
msgstr "Anulación de Informe"
|
msgstr "Anulación de Informe"
|
||||||
|
|
||||||
|
msgctxt "model:lims.results_report_waiting.start,name:"
|
||||||
|
msgid "Results Report Waiting"
|
||||||
|
msgstr "Informe de resultados en espera"
|
||||||
|
|
||||||
msgctxt "model:lims.rule,name:"
|
msgctxt "model:lims.rule,name:"
|
||||||
msgid "Notebook Rule"
|
msgid "Notebook Rule"
|
||||||
msgstr "Regla de cuaderno"
|
msgstr "Regla de cuaderno"
|
||||||
|
@ -13106,6 +13127,10 @@ msgctxt "selection:lims.results_report.version.detail,state:"
|
||||||
msgid "Revised"
|
msgid "Revised"
|
||||||
msgstr "Revisado"
|
msgstr "Revisado"
|
||||||
|
|
||||||
|
msgctxt "selection:lims.results_report.version.detail,state:"
|
||||||
|
msgid "Waiting"
|
||||||
|
msgstr "En espera"
|
||||||
|
|
||||||
msgctxt "selection:lims.results_report.version.detail,type:"
|
msgctxt "selection:lims.results_report.version.detail,type:"
|
||||||
msgid "Complementary"
|
msgid "Complementary"
|
||||||
msgstr "Complementario"
|
msgstr "Complementario"
|
||||||
|
@ -14402,6 +14427,10 @@ msgctxt "view:lims.results_report.version.detail:"
|
||||||
msgid "Time"
|
msgid "Time"
|
||||||
msgstr "Hora"
|
msgstr "Hora"
|
||||||
|
|
||||||
|
msgctxt "view:lims.results_report.version.detail:"
|
||||||
|
msgid "Waiting"
|
||||||
|
msgstr "En espera"
|
||||||
|
|
||||||
msgctxt "view:lims.results_report.version:"
|
msgctxt "view:lims.results_report.version:"
|
||||||
msgid "Laboratories"
|
msgid "Laboratories"
|
||||||
msgstr "Laboratorios"
|
msgstr "Laboratorios"
|
||||||
|
@ -15434,6 +15463,14 @@ msgctxt "wizard_button:lims.results_report_annulation,start,end:"
|
||||||
msgid "Cancel"
|
msgid "Cancel"
|
||||||
msgstr "Cancelar"
|
msgstr "Cancelar"
|
||||||
|
|
||||||
|
msgctxt "wizard_button:lims.results_report_waiting,start,confirm:"
|
||||||
|
msgid "Confirm"
|
||||||
|
msgstr "Confirmar"
|
||||||
|
|
||||||
|
msgctxt "wizard_button:lims.results_report_waiting,start,end:"
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr "Cancelar"
|
||||||
|
|
||||||
msgctxt "wizard_button:lims.sample.add_service,send_ack_of_receipt,end:"
|
msgctxt "wizard_button:lims.sample.add_service,send_ack_of_receipt,end:"
|
||||||
msgid "Cancel"
|
msgid "Cancel"
|
||||||
msgstr "Cancelar"
|
msgstr "Cancelar"
|
||||||
|
|
|
@ -569,6 +569,7 @@ class ResultsReportVersionDetail(Workflow, ModelSQL, ModelView):
|
||||||
valid = fields.Boolean('Active', readonly=True)
|
valid = fields.Boolean('Active', readonly=True)
|
||||||
state = fields.Selection([
|
state = fields.Selection([
|
||||||
('draft', 'Draft'),
|
('draft', 'Draft'),
|
||||||
|
('waiting', 'Waiting'),
|
||||||
('revised', 'Revised'),
|
('revised', 'Revised'),
|
||||||
('released', 'Released'),
|
('released', 'Released'),
|
||||||
('annulled', 'Annulled'),
|
('annulled', 'Annulled'),
|
||||||
|
@ -648,6 +649,7 @@ class ResultsReportVersionDetail(Workflow, ModelSQL, ModelView):
|
||||||
states={'readonly': Eval('state') != 'annulled'}, depends=_depends)
|
states={'readonly': Eval('state') != 'annulled'}, depends=_depends)
|
||||||
annulment_reason_print = fields.Boolean('Print annulment reason',
|
annulment_reason_print = fields.Boolean('Print annulment reason',
|
||||||
states={'readonly': Eval('state') != 'annulled'}, depends=_depends)
|
states={'readonly': Eval('state') != 'annulled'}, depends=_depends)
|
||||||
|
waiting_reason = fields.Text('Waiting reason', readonly=True)
|
||||||
|
|
||||||
# Report format
|
# Report format
|
||||||
report_section = fields.Function(fields.Char('Section'),
|
report_section = fields.Function(fields.Char('Section'),
|
||||||
|
@ -691,6 +693,8 @@ class ResultsReportVersionDetail(Workflow, ModelSQL, ModelView):
|
||||||
cls._order.insert(0, ('report_version', 'DESC'))
|
cls._order.insert(0, ('report_version', 'DESC'))
|
||||||
cls._order.insert(1, ('number', 'DESC'))
|
cls._order.insert(1, ('number', 'DESC'))
|
||||||
cls._transitions = set((
|
cls._transitions = set((
|
||||||
|
('draft', 'waiting'),
|
||||||
|
('waiting', 'draft'),
|
||||||
('draft', 'revised'),
|
('draft', 'revised'),
|
||||||
('revised', 'draft'),
|
('revised', 'draft'),
|
||||||
('revised', 'released'),
|
('revised', 'released'),
|
||||||
|
@ -698,7 +702,7 @@ class ResultsReportVersionDetail(Workflow, ModelSQL, ModelView):
|
||||||
))
|
))
|
||||||
cls._buttons.update({
|
cls._buttons.update({
|
||||||
'draft': {
|
'draft': {
|
||||||
'invisible': Eval('state') != 'revised',
|
'invisible': ~Eval('state').in_(['waiting', 'revised']),
|
||||||
'depends': ['state'],
|
'depends': ['state'],
|
||||||
},
|
},
|
||||||
'revise': {
|
'revise': {
|
||||||
|
@ -843,6 +847,14 @@ class ResultsReportVersionDetail(Workflow, ModelSQL, ModelView):
|
||||||
def default_report_result_type_forced():
|
def default_report_result_type_forced():
|
||||||
return 'none'
|
return 'none'
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def view_attributes(cls):
|
||||||
|
return super().view_attributes() + [
|
||||||
|
('//page[@id="waiting"]', 'states', {
|
||||||
|
'invisible': Eval('state') != 'waiting',
|
||||||
|
}),
|
||||||
|
]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_next_number(cls, report_version_id, d_count):
|
def get_next_number(cls, report_version_id, d_count):
|
||||||
detail_number = cls.search_count([
|
detail_number = cls.search_count([
|
||||||
|
@ -3000,6 +3012,55 @@ class NewResultsReportVersion(Wizard):
|
||||||
return 'end'
|
return 'end'
|
||||||
|
|
||||||
|
|
||||||
|
class ResultsReportWaitingStart(ModelView):
|
||||||
|
'Results Report Waiting'
|
||||||
|
__name__ = 'lims.results_report_waiting.start'
|
||||||
|
|
||||||
|
waiting_reason = fields.Text('Waiting reason', required=True)
|
||||||
|
|
||||||
|
|
||||||
|
class ResultsReportWaiting(Wizard):
|
||||||
|
'Results Report Waiting'
|
||||||
|
__name__ = 'lims.results_report_waiting'
|
||||||
|
|
||||||
|
start_state = 'check'
|
||||||
|
check = StateTransition()
|
||||||
|
start = StateView('lims.results_report_waiting.start',
|
||||||
|
'lims.lims_results_report_waiting_start_view_form', [
|
||||||
|
Button('Cancel', 'end', 'tryton-cancel'),
|
||||||
|
Button('Confirm', 'confirm', 'tryton-ok', default=True),
|
||||||
|
])
|
||||||
|
confirm = StateTransition()
|
||||||
|
|
||||||
|
def transition_check(self):
|
||||||
|
ResultsDetail = Pool().get('lims.results_report.version.detail')
|
||||||
|
|
||||||
|
details = ResultsDetail.search([
|
||||||
|
('id', 'in', Transaction().context['active_ids']),
|
||||||
|
('state', '=', 'draft'),
|
||||||
|
])
|
||||||
|
if details:
|
||||||
|
return 'start'
|
||||||
|
return 'end'
|
||||||
|
|
||||||
|
def transition_confirm(self):
|
||||||
|
ResultsDetail = Pool().get('lims.results_report.version.detail')
|
||||||
|
|
||||||
|
details = ResultsDetail.search([
|
||||||
|
('id', 'in', Transaction().context['active_ids']),
|
||||||
|
('state', '=', 'draft'),
|
||||||
|
])
|
||||||
|
if details:
|
||||||
|
ResultsDetail.write(details, {
|
||||||
|
'state': 'waiting',
|
||||||
|
'waiting_reason': self.start.waiting_reason,
|
||||||
|
})
|
||||||
|
return 'end'
|
||||||
|
|
||||||
|
def end(self):
|
||||||
|
return 'reload'
|
||||||
|
|
||||||
|
|
||||||
class PrintResultReport(Wizard):
|
class PrintResultReport(Wizard):
|
||||||
'Print Results Report'
|
'Print Results Report'
|
||||||
__name__ = 'lims.print_result_report'
|
__name__ = 'lims.print_result_report'
|
||||||
|
|
|
@ -182,10 +182,19 @@
|
||||||
<field name="count" eval="True"/>
|
<field name="count" eval="True"/>
|
||||||
<field name="act_window" ref="act_lims_results_report_version_detail"/>
|
<field name="act_window" ref="act_lims_results_report_version_detail"/>
|
||||||
</record>
|
</record>
|
||||||
|
<record model="ir.action.act_window.domain"
|
||||||
|
id="act_lims_results_report_version_detail_domain_waiting">
|
||||||
|
<field name="name">Waiting</field>
|
||||||
|
<field name="sequence" eval="20"/>
|
||||||
|
<field name="domain"
|
||||||
|
eval="[('state', '=', 'waiting')]" pyson="1"/>
|
||||||
|
<field name="count" eval="True"/>
|
||||||
|
<field name="act_window" ref="act_lims_results_report_version_detail"/>
|
||||||
|
</record>
|
||||||
<record model="ir.action.act_window.domain"
|
<record model="ir.action.act_window.domain"
|
||||||
id="act_lims_results_report_version_detail_domain_revised">
|
id="act_lims_results_report_version_detail_domain_revised">
|
||||||
<field name="name">Revised</field>
|
<field name="name">Revised</field>
|
||||||
<field name="sequence" eval="20"/>
|
<field name="sequence" eval="30"/>
|
||||||
<field name="domain"
|
<field name="domain"
|
||||||
eval="[('state', '=', 'revised')]" pyson="1"/>
|
eval="[('state', '=', 'revised')]" pyson="1"/>
|
||||||
<field name="count" eval="True"/>
|
<field name="count" eval="True"/>
|
||||||
|
@ -194,7 +203,7 @@
|
||||||
<record model="ir.action.act_window.domain"
|
<record model="ir.action.act_window.domain"
|
||||||
id="act_lims_results_report_version_detail_domain_released">
|
id="act_lims_results_report_version_detail_domain_released">
|
||||||
<field name="name">Released</field>
|
<field name="name">Released</field>
|
||||||
<field name="sequence" eval="30"/>
|
<field name="sequence" eval="40"/>
|
||||||
<field name="domain"
|
<field name="domain"
|
||||||
eval="[('state', '=', 'released')]" pyson="1"/>
|
eval="[('state', '=', 'released')]" pyson="1"/>
|
||||||
<field name="act_window" ref="act_lims_results_report_version_detail"/>
|
<field name="act_window" ref="act_lims_results_report_version_detail"/>
|
||||||
|
@ -202,7 +211,7 @@
|
||||||
<record model="ir.action.act_window.domain"
|
<record model="ir.action.act_window.domain"
|
||||||
id="act_lims_results_report_version_detail_domain_annulled">
|
id="act_lims_results_report_version_detail_domain_annulled">
|
||||||
<field name="name">Annulled</field>
|
<field name="name">Annulled</field>
|
||||||
<field name="sequence" eval="40"/>
|
<field name="sequence" eval="50"/>
|
||||||
<field name="domain"
|
<field name="domain"
|
||||||
eval="[('state', '=', 'annulled')]" pyson="1"/>
|
eval="[('state', '=', 'annulled')]" pyson="1"/>
|
||||||
<field name="act_window" ref="act_lims_results_report_version_detail"/>
|
<field name="act_window" ref="act_lims_results_report_version_detail"/>
|
||||||
|
@ -693,6 +702,25 @@
|
||||||
<field name="wiz_name">lims.results_report.version.detail.new_version</field>
|
<field name="wiz_name">lims.results_report.version.detail.new_version</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<!-- Wizard Report Waiting -->
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="lims_results_report_waiting_start_view_form">
|
||||||
|
<field name="model">lims.results_report_waiting.start</field>
|
||||||
|
<field name="type">form</field>
|
||||||
|
<field name="name">results_report_waiting_form</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.action.wizard" id="wiz_lims_results_report_waiting">
|
||||||
|
<field name="name">Report Waiting</field>
|
||||||
|
<field name="wiz_name">lims.results_report_waiting</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.action.keyword" id="wiz_lims_results_report_waiting_keyword">
|
||||||
|
<field name="keyword">form_action</field>
|
||||||
|
<field name="model">lims.results_report.version.detail,-1</field>
|
||||||
|
<field name="action" ref="wiz_lims_results_report_waiting"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
<!-- Wizard Repeat Analysis -->
|
<!-- Wizard Repeat Analysis -->
|
||||||
|
|
||||||
<record model="ir.action.wizard"
|
<record model="ir.action.wizard"
|
||||||
|
|
|
@ -39,6 +39,10 @@
|
||||||
<page name="fractions_comments">
|
<page name="fractions_comments">
|
||||||
<field name="fractions_comments" colspan="4"/>
|
<field name="fractions_comments" colspan="4"/>
|
||||||
</page>
|
</page>
|
||||||
|
<page id="waiting" string="Waiting">
|
||||||
|
<separator name="waiting_reason" colspan="4"/>
|
||||||
|
<field name="waiting_reason" colspan="4"/>
|
||||||
|
</page>
|
||||||
<page id="annulation" string="Annulation">
|
<page id="annulation" string="Annulation">
|
||||||
<separator name="annulment_reason" colspan="4"/>
|
<separator name="annulment_reason" colspan="4"/>
|
||||||
<field name="annulment_reason" colspan="4"/>
|
<field name="annulment_reason" colspan="4"/>
|
||||||
|
|
5
lims/view/results_report_waiting_form.xml
Normal file
5
lims/view/results_report_waiting_form.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<form>
|
||||||
|
<separator name="waiting_reason" colspan="4"/>
|
||||||
|
<field name="waiting_reason" colspan="4"/>
|
||||||
|
</form>
|
|
@ -28,6 +28,8 @@ class ResultsReportVersionDetail(metaclass=PoolMeta):
|
||||||
if diagnosed_state not in cls.state.selection:
|
if diagnosed_state not in cls.state.selection:
|
||||||
cls.state.selection.append(diagnosed_state)
|
cls.state.selection.append(diagnosed_state)
|
||||||
cls._transitions = set((
|
cls._transitions = set((
|
||||||
|
('draft', 'waiting'),
|
||||||
|
('waiting', 'draft'),
|
||||||
('draft', 'diagnosed'),
|
('draft', 'diagnosed'),
|
||||||
('diagnosed', 'draft'),
|
('diagnosed', 'draft'),
|
||||||
('diagnosed', 'revised'),
|
('diagnosed', 'revised'),
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
<record model="ir.action.act_window.domain"
|
<record model="ir.action.act_window.domain"
|
||||||
id="act_lims_results_report_version_detail_domain_diagnosed">
|
id="act_lims_results_report_version_detail_domain_diagnosed">
|
||||||
<field name="name">Diagnosed</field>
|
<field name="name">Diagnosed</field>
|
||||||
<field name="sequence" eval="15"/>
|
<field name="sequence" eval="25"/>
|
||||||
<field name="domain"
|
<field name="domain"
|
||||||
eval="[('state', '=', 'diagnosed')]" pyson="1"/>
|
eval="[('state', '=', 'diagnosed')]" pyson="1"/>
|
||||||
<field name="count" eval="True"/>
|
<field name="count" eval="True"/>
|
||||||
|
|
Loading…
Reference in a new issue