From 54f96ea92bb244aacf5ab72c3345a08f0a71311e Mon Sep 17 00:00:00 2001 From: Samuel Fringeli Date: Wed, 21 Feb 2018 17:20:20 +0100 Subject: [PATCH] CO-1444 - ability to set several jobs to done --- queue_job/models/queue_job.py | 12 ++++++++++ queue_job/views/queue_job_views.xml | 35 ++++++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/queue_job/models/queue_job.py b/queue_job/models/queue_job.py index 961dd7dfff..c980cd9af4 100644 --- a/queue_job/models/queue_job.py +++ b/queue_job/models/queue_job.py @@ -241,6 +241,18 @@ def requeue(self): return {'type': 'ir.actions.act_window_close'} +class SetJobsToDone(models.TransientModel): + _inherit = 'queue.requeue.job' + _name = 'queue.jobs.to.done' + _description = 'Set all selected jobs to done' + + @api.multi + def set_done(self): + jobs = self.job_ids + jobs.button_done() + return {'type': 'ir.actions.act_window_close'} + + class JobChannel(models.Model): _name = 'queue.job.channel' _description = 'Job Channels' diff --git a/queue_job/views/queue_job_views.xml b/queue_job/views/queue_job_views.xml index ce71297535..22a33061d3 100644 --- a/queue_job/views/queue_job_views.xml +++ b/queue_job/views/queue_job_views.xml @@ -150,7 +150,22 @@ + + + + + + Requeue Jobs + queue.jobs.to.done + +
+ + + +
+
@@ -175,6 +190,24 @@ queue.job
+ + Set jobs to done + queue.jobs.to.done + form + form + + new + + + + + Set jobs to done + client_action_multi + + action + queue.job + + queue.job.channel.form queue.job.channel