diff --git a/queue_job/models/queue_job.py b/queue_job/models/queue_job.py index 516d052348..84eea27a79 100644 --- a/queue_job/models/queue_job.py +++ b/queue_job/models/queue_job.py @@ -303,6 +303,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/readme/HISTORY.rst b/queue_job/readme/HISTORY.rst index 78d19ec69e..038c2ffa7f 100644 --- a/queue_job/readme/HISTORY.rst +++ b/queue_job/readme/HISTORY.rst @@ -11,6 +11,8 @@ Next ~~~~ +* [ADD] Ability to set several jobs to done using an multi-action + (port of `#59 `_) * [REF] Extract a method handling the post of a message when a job is failed, allowing to modify this behavior from addons diff --git a/queue_job/views/queue_job_views.xml b/queue_job/views/queue_job_views.xml index f30f3dece4..ac1fa87b49 100644 --- a/queue_job/views/queue_job_views.xml +++ b/queue_job/views/queue_job_views.xml @@ -151,7 +151,22 @@ + + + + + + Set Jobs to Done + queue.jobs.to.done + +
+ + + +
+
@@ -168,6 +183,16 @@
+ + Set jobs to done + queue.jobs.to.done + form + form + + new + + + queue.job.channel.form queue.job.channel