Skip to content

Commit

Permalink
[13.0][FIX] queue_job_cron: channel_id must be storable.
Browse files Browse the repository at this point in the history
Otherwise, you cannot use any channel other than default (
root.ir_cron)
  • Loading branch information
LoisRForgeFlow authored and florentx committed Dec 27, 2024
1 parent f202072 commit 2b0c033
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion queue_job_cron/models/ir_cron.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@ class IrCron(models.Model):
comodel_name="queue.job.channel",
compute="_compute_run_as_queue_job",
readonly=False,
store=True,
string="Channel",
)

@api.depends("run_as_queue_job")
def _compute_run_as_queue_job(self):
for cron in self:
if cron.run_as_queue_job and not cron.channel_id:
if cron.channel_id:
continue

Check warning on line 39 in queue_job_cron/models/ir_cron.py

View check run for this annotation

Codecov / codecov/patch

queue_job_cron/models/ir_cron.py#L39

Added line #L39 was not covered by tests
if cron.run_as_queue_job:
cron.channel_id = self.env.ref("queue_job_cron.channel_root_ir_cron").id
else:
cron.channel_id = False
Expand Down

0 comments on commit 2b0c033

Please sign in to comment.