Добавил при закрытии позиции сохранение в факт.выполнено для красивости прогресбаров
All checks were successful
Deploy MES Core / deploy (push) Successful in 12s
All checks were successful
Deploy MES Core / deploy (push) Successful in 12s
This commit is contained in:
@@ -198,13 +198,14 @@ def apply_closing_workitems(
|
||||
created_shift += 1
|
||||
|
||||
wi.quantity_done = done_total + fact
|
||||
wi.quantity_reported = max(int(wi.quantity_reported or 0), int(wi.quantity_done or 0))
|
||||
if wi.quantity_done >= plan_total:
|
||||
wi.status = 'done'
|
||||
elif wi.quantity_done > 0:
|
||||
wi.status = 'leftover'
|
||||
else:
|
||||
wi.status = 'planned'
|
||||
wi.save(update_fields=['quantity_done', 'status'])
|
||||
wi.save(update_fields=['quantity_done', 'quantity_reported', 'status'])
|
||||
|
||||
for stock_item_id, qty in consumptions.items():
|
||||
if qty and float(qty) > 0:
|
||||
|
||||
Reference in New Issue
Block a user