Skip to content

Commit

Permalink
Add ddmrp_cron_actions_as_job
Browse files Browse the repository at this point in the history
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 OCA/queue#274 and
OCA/queue#275
  • Loading branch information
guewen authored and cormaza committed Dec 15, 2021
1 parent d373850 commit b6bd1bc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ddmrp/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit b6bd1bc

Please sign in to comment.