lims: planification: change cron to task queue

This commit is contained in:
Adrián Bernardi 2021-02-19 19:15:39 -03:00
parent 5ce81e79af
commit 9761ce26bc
4 changed files with 3 additions and 30 deletions

View file

@ -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'

View file

@ -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"

View file

@ -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):

View file

@ -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"/>