diff --git a/apps/inm/services.py b/apps/inm/services.py index dba22bff..c0046a9a 100644 --- a/apps/inm/services.py +++ b/apps/inm/services.py @@ -373,7 +373,10 @@ class InmService: ddict["material_ofrom"] = i.material if field == "count": - count_change = i.count - i.count_notok + if i.test_date is not None: + count_change = i.count - i.count_notok + else: + count_change = i.count elif field == "count_notok": count_change = getattr(i, field) else: