From a3568f6bb0030761c8734516dcbe501074ee7524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 23 Oct 2024 19:34:26 +0200 Subject: [PATCH] Do not update planned date of production moves if it is not needed --- modules/production/production.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/production/production.py b/modules/production/production.py index 2f67798507..633d5749ef 100644 --- a/modules/production/production.py +++ b/modules/production/production.py @@ -692,15 +692,19 @@ class Production(ShipmentAssignMixin, Workflow, ModelSQL, ModelView): for production in productions: dates = production._get_move_planned_date() input_date, output_date = dates - inputs = [m for m in production.inputs - if m.state not in {'done', 'cancelled'}] + inputs = [ + m for m in production.inputs + if m.state not in {'done', 'cancelled'} + and m.planned_date != input_date] if inputs: to_write.append(inputs) to_write.append({ 'planned_date': input_date, }) - outputs = [m for m in production.outputs - if m.state not in {'done', 'cancelled'}] + outputs = [ + m for m in production.outputs + if m.state not in {'done', 'cancelled'} + and m.planned_date != output_date] if outputs: to_write.append(outputs) to_write.append({