Ввел логику сделок через партии
All checks were successful
Deploy MES Core / deploy (push) Successful in 4m16s
All checks were successful
Deploy MES Core / deploy (push) Successful in 4m16s
This commit is contained in:
@@ -185,7 +185,12 @@ def apply_closing_workitems(
|
||||
if fact <= 0:
|
||||
raise RuntimeError('При частичном закрытии факт должен быть больше 0.')
|
||||
|
||||
pt = ProductionTask.objects.filter(deal_id=wi.deal_id, entity_id=wi.entity_id).first()
|
||||
pt_qs = ProductionTask.objects.filter(deal_id=wi.deal_id, entity_id=wi.entity_id)
|
||||
if getattr(wi, 'delivery_batch_id', None):
|
||||
pt_qs = pt_qs.filter(delivery_batch_id=wi.delivery_batch_id)
|
||||
else:
|
||||
pt_qs = pt_qs.filter(delivery_batch_id__isnull=True)
|
||||
pt = pt_qs.first()
|
||||
if not pt:
|
||||
raise RuntimeError('Не найден ProductionTask для задания.')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user