Do not update planned date of production moves if it is not needed
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user