From 7dc2c37c647b7f8a838107146c5c7a7b6c4b8c2e Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Thu, 28 Nov 2024 14:43:04 +0100 Subject: [PATCH] [IMP] stock_quant_task_deferred: Use identity exact to not launch several parallel quant tasks --- stock_quant_task_deferred/models/stock_quant.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/stock_quant_task_deferred/models/stock_quant.py b/stock_quant_task_deferred/models/stock_quant.py index 9e3f3187e62..05405edf29c 100644 --- a/stock_quant_task_deferred/models/stock_quant.py +++ b/stock_quant_task_deferred/models/stock_quant.py @@ -1,8 +1,9 @@ # Copyright 2024 ACSONE SA/NV # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). - from odoo import api, models +from odoo.addons.queue_job.job import identity_exact + class StockQuant(models.Model): @@ -23,4 +24,6 @@ def _quant_tasks_deferred(self): @api.model def _run_quant_tasks_deferred(self): - self.with_delay(description="Executing Quant Tasks")._quant_tasks_deferred() + self.with_delay( + description="Executing Quant Tasks", identity_key=identity_exact + )._quant_tasks_deferred()