From b6bd1bc99406e0a62edd1d00e23325fb6922e05d Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Thu, 29 Oct 2020 09:04:43 +0100 Subject: [PATCH] Add ddmrp_cron_actions_as_job It makes calls to "cron_actions" run in queue jobs. The jobs have an identity key with "identity_exact", meaning that only one occurence of a job for the same buffer with the same arguments (only_nfp) will be created at a time (e.g. when the state of a stock.move is changed several times in the same transaction or in a different transaction in a short timeframe). It needs https://github.com/OCA/queue/pull/274 and https://github.com/OCA/queue/pull/275 --- ddmrp/tests/common.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ddmrp/tests/common.py b/ddmrp/tests/common.py index e6fcac8f6..524297453 100644 --- a/ddmrp/tests/common.py +++ b/ddmrp/tests/common.py @@ -12,6 +12,16 @@ class TestDdmrpCommon(common.SavepointCase): def setUpClass(cls): super().setUpClass() + cls.env = cls.env( + context=dict( + cls.env.context, + tracking_disable=True, + # compatibility with ddmrp_cron_actions_as_job, + # that would delay calls to "cron_actions" in these tests + test_queue_job_no_delay=True, + ) + ) + # Models cls.productModel = cls.env["product.product"] cls.templateModel = cls.env["product.template"]