mirror of
https://github.com/Kalenis/kalenislims.git
synced 2023-12-14 07:13:04 +01:00
lims: planification: change cron to task queue
This commit is contained in:
parent
5ce81e79af
commit
9761ce26bc
|
@ -205,8 +205,6 @@ class Configuration(ModelSingleton, ModelSQL, ModelView,
|
|||
'ITL fraction type')
|
||||
reagents = fields.Many2Many('lims.configuration-product.category',
|
||||
'configuration', 'category', 'Reagents')
|
||||
planification_process_background = fields.Boolean(
|
||||
'Process Planifications in Background')
|
||||
invoice_party_relation_type = fields.Many2One('party.relation.type',
|
||||
'Invoice Party Relation Type')
|
||||
samples_in_progress = fields.Selection([
|
||||
|
@ -260,10 +258,6 @@ class Configuration(ModelSingleton, ModelSQL, ModelView,
|
|||
return cls.multivalue_model(
|
||||
'referral_sequence').default_referral_sequence()
|
||||
|
||||
@staticmethod
|
||||
def default_planification_process_background():
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
def default_samples_in_progress():
|
||||
return 'result'
|
||||
|
|
|
@ -467,10 +467,6 @@ msgctxt "field:lims.configuration,notebook_lines_acceptance_method:"
|
|||
msgid "Allow to accept the same analysis with different methods"
|
||||
msgstr "Permitir aceptar el mismo análisis con diferentes métodos"
|
||||
|
||||
msgctxt "field:lims.configuration,planification_process_background:"
|
||||
msgid "Process Planifications in Background"
|
||||
msgstr "Procesar planificaciones en segundo plano"
|
||||
|
||||
msgctxt "field:lims.configuration,planification_sequence:"
|
||||
msgid "Planification Sequence"
|
||||
msgstr "Secuencia de planificaciones"
|
||||
|
|
|
@ -379,19 +379,12 @@ class Planification(Workflow, ModelSQL, ModelView):
|
|||
@ModelView.button
|
||||
@Workflow.transition('not_executed')
|
||||
def release_controls(cls, planifications):
|
||||
Config = Pool().get('lims.configuration')
|
||||
process_background = Config(1).planification_process_background
|
||||
|
||||
for planification in planifications:
|
||||
# Check if is still waiting for confirmation
|
||||
if planification.waiting_process:
|
||||
raise UserError(gettext('lims.msg_waiting_process',
|
||||
planification=planification.code))
|
||||
if process_background:
|
||||
planification.waiting_process = True
|
||||
planification.save()
|
||||
if not process_background:
|
||||
cls.do_release_controls(planifications)
|
||||
cls.__queue__.do_release_controls(planifications)
|
||||
|
||||
@classmethod
|
||||
def do_release_controls(cls, planifications):
|
||||
|
@ -5277,19 +5270,11 @@ class TechniciansQualification(Wizard):
|
|||
})
|
||||
|
||||
def transition_confirm(self):
|
||||
pool = Pool()
|
||||
Planification = pool.get('lims.planification')
|
||||
Config = pool.get('lims.configuration')
|
||||
process_background = Config(1).planification_process_background
|
||||
|
||||
Planification = Pool().get('lims.planification')
|
||||
planification = Planification(Transaction().context['active_id'])
|
||||
planification.state = 'confirmed'
|
||||
if process_background:
|
||||
planification.waiting_process = True
|
||||
planification.save()
|
||||
|
||||
if not process_background:
|
||||
Planification.do_confirm([planification])
|
||||
Planification.__queue__.do_confirm([planification])
|
||||
return 'end'
|
||||
|
||||
def _get_supervisors(self, data):
|
||||
|
|
|
@ -20,8 +20,6 @@
|
|||
<field name="analysis_product_category"/>
|
||||
<label name="entry_confirm_background"/>
|
||||
<field name="entry_confirm_background"/>
|
||||
<label name="planification_process_background"/>
|
||||
<field name="planification_process_background"/>
|
||||
<label name="entry_default_contacts"/>
|
||||
<field name="entry_default_contacts"/>
|
||||
<label name="samples_in_progress"/>
|
||||
|
|
Loading…
Reference in a new issue