diff --git a/core/apps/orders/management/commands/import_party.py b/core/apps/orders/management/commands/import_party.py index 69563c3..2e4b1ff 100644 --- a/core/apps/orders/management/commands/import_party.py +++ b/core/apps/orders/management/commands/import_party.py @@ -74,7 +74,7 @@ class Command(BaseCommand): ).first() if not product: continue - unit = Unity.objects.filter(value=i["unit"]["name"]["uz"]).first() + unit, created = Unity.objects.get_or_create(value=i["unit"]["name"]["uz"]) counterparty = Counterparty.objects.filter( name=i["company_person"]["name"] ).first()