From 90a3628fbe99c02fc0df63b603bf90480405eb06 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Tue, 1 Oct 2024 13:49:34 +0200 Subject: [PATCH] Only consider done forecast when checking if they overlap Closes #13553 (grafted from b498598f80391fb99aef7cb7a0a03d79badf143e) --HG-- branch : 7.0 --- modules/stock_forecast/forecast.py | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/stock_forecast/forecast.py b/modules/stock_forecast/forecast.py index 7ca202bd5a..4ded022d8f 100644 --- a/modules/stock_forecast/forecast.py +++ b/modules/stock_forecast/forecast.py @@ -213,6 +213,7 @@ class Forecast(Workflow, ModelSQL, ModelView): & (table.warehouse == forecast.warehouse.id) & (table.destination == forecast.destination.id) & (table.company == forecast.company.id) + & (table.state == 'done') & (table.id != forecast.id))) forecast_id = cursor.fetchone() if forecast_id: