From 8cc77dcd43180732ced98c2d3c586570b8af930c Mon Sep 17 00:00:00 2001 From: Mojtaba-z Date: Wed, 3 Sep 2025 09:54:02 +0330 Subject: [PATCH] fix device assignment for non organization clients --- apps/pos_device/web/api/v1/viewsets/device.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/pos_device/web/api/v1/viewsets/device.py b/apps/pos_device/web/api/v1/viewsets/device.py index e634831..bafd51d 100644 --- a/apps/pos_device/web/api/v1/viewsets/device.py +++ b/apps/pos_device/web/api/v1/viewsets/device.py @@ -204,7 +204,15 @@ class DeviceAssignmentViewSet(viewsets.ModelViewSet, SoftDeleteMixin): data['client'] = client_id elif client_data and client_data.get('organization') is False: - pass + # create client + client = CustomOperations().custom_create( + request=request, + view=POSClientViewSet(), + data=request.data['client_data'] + ) + client_id = client['id'] + + data['client'] = client_id # create assignment serializer = self.serializer_class(data=data)