Uh oh!
There was an error while loading. Please reload this page.
[17.0][MIG] queue_job + test_queue_job: Migration to 17.0 - #593
Conversation
Currently translated at 3.7% (5 of 135 strings) Translation: queue-15.0/queue-15.0-queue_job Translate-URL: https://translation.odoo-community.org/projects/queue-15-0/queue-15-0-queue_job/es/
Currently translated at 100.0% (135 of 135 strings) Translation: queue-15.0/queue-15.0-queue_job Translate-URL: https://translation.odoo-community.org/projects/queue-15-0/queue-15-0-queue_job/es/
Currently translated at 83.2% (114 of 137 strings) Translation: queue-15.0/queue-15.0-queue_job Translate-URL: https://translation.odoo-community.org/projects/queue-15-0/queue-15-0-queue_job/zh_CN/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: queue-16.0/queue-16.0-queue_job Translate-URL: https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-queue_job/
It can still be activated by overriding a method.
…n test if addon not loaded. TT35938
…se_sparse_field) from server_wide_modules. OCA#443 (comment)
Co-authored-by: Stéphane Bidoul <stephane.bidoul@acsone.eu>
Current situation: * multiple keys for no good reason * half baked: not all of them used everywhere * no centralization * poor naming With this change we'll have: * 1 and only one key to disable via ctx: ``queue_job__no_delay`` * 1 and only one key to disable via os env: ``QUEUE_JOB__NO_DELAY`` * backward compatibility with deprecation for old keys
The trap_jobs() test helper accepts any model/recordset as long
as the job function is the same, which is not enough to verify that
the job has been delayed on the expected recordset or model.
Tested job functions are "bound methods" so we can compare their `__self__`.
Example of assertion that would be valid:
partner = self.env["res.partner"].create({"name": "foo"})
with trap_jobs() as trap:
partner.with_delay().do_something(42)
trap.assert_enqueued_job(
self.env["res.partner"].do_something,
args=(42,)
)
trap.assert_jobs_count(1, only=self.env["res.partner"].do_something)
Now, it would fail with an error message like:
E AssertionError: Job <res.partner()>.do_something(42) with properties (channel=root.test, description=Do something, eta=15, identity_key=<function identity_exact at 0x7f01bfb54cb0>, max_retries=1, priority=15) was not enqueued.
E Actual enqueued jobs:
E * <res.partner(64,)>.do_something(42) with properties (priority=15, max_retries=1, eta=15, description=Do something, channel=root.test, identity_key=<function identity_exact at 0x7f01bfb54cb0>)Currently translated at 100.0% (13 of 13 strings) Translation: queue-16.0/queue-16.0-test_queue_job Translate-URL: https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-test_queue_job/es/
1. In production, a job which is waiting dependencies or which has started, but not completed, should not be repeated if the identity_key matches. 2. In tests, the mock queue handler is now enhanced to allow better mimicking of the identity_key blocks from production. 3. In tests, the mock queue handler now clears the enqueued jobs after performing them, to better reproduce what a production environment would do.
046275d to
686691bComparenguyenminhchien
commented
Dec 4, 2023
fixed, tks. |
ventor-dev
commented
Dec 4, 2023
Can it be merged? Or smth else is missing? |
AlexanderPashuk
commented
Dec 5, 2023
@guewen can we help somehow to finish migration of this module? |
guewen
commented
Dec 5, 2023
/ocabot merge nobump |
OCA-git-bot
commented
Dec 5, 2023
What a great day to merge this nice PR. Let's do it! |
OCA-git-bot
commented
Dec 5, 2023
Congratulations, your PR was merged at a70fda8. Thanks a lot for contributing to OCA. ❤️ |
okuryan
commented
Dec 5, 2023
@pedrobaeza can you (or who is responsible?) publish it on Odoo App store? |
pedrobaeza
commented
Dec 5, 2023
Someone from board should do it. |
simahawk
commented
Dec 5, 2023
I can have a look |
simahawk
commented
Dec 5, 2023
gurneyalex
commented
Dec 8, 2023
/ocabot migration test_queue_job |

Ref: BSRD-729