Исправил отображение текущего состояния фабрики путем создания дополнительной записи FabricWorkTime
This commit is contained in:
parent
8b0c8a4d42
commit
9fd533d7bc
@ -43,6 +43,11 @@ def create_worktime_data() -> int:
|
||||
if delta > 5:
|
||||
status = 'NW'
|
||||
if rec:
|
||||
next_rec = FabricWorkTime.objects.filter(time=record.time.replace(second=0, microsecond=0))
|
||||
if next_rec:
|
||||
next_rec_obj = next_rec.first()
|
||||
next_rec_obj.status = status
|
||||
next_rec_obj.save()
|
||||
last_rec = rec.last()
|
||||
last_rec.status = status
|
||||
last_rec.save()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user