From 9793aade9155da6a5fb49d1577fb98def62604b4 Mon Sep 17 00:00:00 2001 From: Holoborodko Bohdan Date: Tue, 15 Sep 2026 11:31:02 +0000 Subject: [PATCH 1/8] [FIX] queue_job: validate JobSerialized base_type again Odoo 19 renamed Field._setup_attrs to _setup_attrs__, so the override was no longer called and an unsupported base_type was silently accepted. --- queue_job/fields.py | 4 ++-- queue_job/tests/test_json_field.py | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/queue_job/fields.py b/queue_job/fields.py index d9f371605f..bb5b6597ae 100644 --- a/queue_job/fields.py +++ b/queue_job/fields.py @@ -42,8 +42,8 @@ class JobSerialized(fields.Json): def __init__(self, string=SENTINEL, base_type=SENTINEL, **kwargs): super().__init__(string=string, _base_type=base_type, **kwargs) - def _setup_attrs(self, model, name): # pylint: disable=missing-return - super()._setup_attrs(model, name) + def _setup_attrs__(self, model, name): # pylint: disable=missing-return + super()._setup_attrs__(model, name) if self._base_type not in self._default_json_mapping: msg = f"{self._base_type} is not a supported base type" raise ValueError(msg) diff --git a/queue_job/tests/test_json_field.py b/queue_job/tests/test_json_field.py index 23974e23c9..2f7c886f14 100644 --- a/queue_job/tests/test_json_field.py +++ b/queue_job/tests/test_json_field.py @@ -11,7 +11,7 @@ # pylint: disable=odoo-addons-relative-import # we are testing, we want to test as we were an external consumer of the API -from odoo.addons.queue_job.fields import JobDecoder, JobEncoder +from odoo.addons.queue_job.fields import JobDecoder, JobEncoder, JobSerialized class TestJson(common.TransactionCase): @@ -195,3 +195,9 @@ def test_decoder_etree(self): value = json.loads(value_json, cls=JobDecoder, env=self.env) value[2] = etree.tostring(value[2]) self.assertEqual(value, expected) + + def test_job_serialized_base_type_is_validated(self): + model_class = type(self.env["queue.job"]) + JobSerialized(base_type=dict)._setup_attrs__(model_class, "supported") + with self.assertRaisesRegex(ValueError, "is not a supported base type"): + JobSerialized(base_type=int)._setup_attrs__(model_class, "unsupported") From 3d75b4c379fb83682b925f5595ce938d639e4243 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 5 Oct 2026 17:41:13 +0000 Subject: [PATCH 2/8] [BOT] post-merge updates --- queue_job/README.rst | 2 +- queue_job/__manifest__.py | 2 +- queue_job/static/description/index.html | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/queue_job/README.rst b/queue_job/README.rst index f9a974d192..890d52f762 100644 --- a/queue_job/README.rst +++ b/queue_job/README.rst @@ -11,7 +11,7 @@ Job Queue !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:aee74431fafa74d2abc078c3686e4d9c6390bacc001cac7c4afa01b9db77ca06 + !! source digest: sha256:f8cd4a2bc31b48b3081573ba07c2396b47bb99f749d5125d10fcde512a987212 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png diff --git a/queue_job/__manifest__.py b/queue_job/__manifest__.py index 03ea411f2c..3d82bb086d 100644 --- a/queue_job/__manifest__.py +++ b/queue_job/__manifest__.py @@ -2,7 +2,7 @@ { "name": "Job Queue", - "version": "19.0.2.1.3", + "version": "19.0.2.1.4", "author": "Camptocamp,ACSONE SA/NV,Odoo Community Association (OCA)", "website": "https://github.com/OCA/queue", "license": "LGPL-3", diff --git a/queue_job/static/description/index.html b/queue_job/static/description/index.html index 58b23819d8..ccf5d86df4 100644 --- a/queue_job/static/description/index.html +++ b/queue_job/static/description/index.html @@ -3,7 +3,7 @@ -README.rst +Job Queue