Skip to content

Commit c223425

Browse files
LoisRForgeFlowflorentx
authored andcommitted
[13.0][FIX] queue_job_cron: channel_id must be storable.
Otherwise, you cannot use any channel other than default ( root.ir_cron)
1 parent 88df44d commit c223425

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

queue_job_cron/models/ir_cron.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,16 @@ class IrCron(models.Model):
2828
comodel_name="queue.job.channel",
2929
compute="_compute_run_as_queue_job",
3030
readonly=False,
31+
store=True,
3132
string="Channel",
3233
)
3334

3435
@api.depends("run_as_queue_job")
3536
def _compute_run_as_queue_job(self):
3637
for cron in self:
37-
if cron.run_as_queue_job and not cron.channel_id:
38+
if cron.channel_id:
39+
continue
40+
if cron.run_as_queue_job:
3841
cron.channel_id = self.env.ref("queue_job_cron.channel_root_ir_cron").id
3942
else:
4043
cron.channel_id = False

0 commit comments

Comments
 (0)