From 26c078bf263c31b0c233193c77851d8cc6980899 Mon Sep 17 00:00:00 2001 From: hichamlahlou Date: Thu, 23 Jan 2025 13:29:55 +0100 Subject: [PATCH] no need to update unchanged records --- freppledb/forecast/commands.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/freppledb/forecast/commands.py b/freppledb/forecast/commands.py index 57b7f88eb..95bcd93a7 100644 --- a/freppledb/forecast/commands.py +++ b/freppledb/forecast/commands.py @@ -576,7 +576,8 @@ def run(cls, database=DEFAULT_DB_ALIAS, **kwargs): WHERE forecastplan.item_id = demand_agg.item_id AND forecastplan.location_id = demand_agg.location_id AND forecastplan.customer_id = demand_agg.customer_id - AND forecastplan.startdate = demand_agg.startdate); + AND forecastplan.startdate = demand_agg.startdate) + and (ordersopen is not NULL or ordersopenvalue is not null or orderstotal is not NULL or orderstotalvalue is not NULL); """ )