From c495309cc6f2c38bcbb92b3557b2d60c4fc85f6c Mon Sep 17 00:00:00 2001 From: Mojtaba-z Date: Tue, 11 Nov 2025 14:31:59 +0330 Subject: [PATCH] fix - transaction search --- apps/herd/pos/api/v1/api.py | 4 ++-- apps/warehouse/web/api/v1/api.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/herd/pos/api/v1/api.py b/apps/herd/pos/api/v1/api.py index 3653bb4..0e5a300 100644 --- a/apps/herd/pos/api/v1/api.py +++ b/apps/herd/pos/api/v1/api.py @@ -140,8 +140,8 @@ class RancherViewSet(viewsets.ModelViewSet, DynamicSearchMixin): rancher = self.queryset.filter(national_code=request.data['national_code']) - # if len(rancher) > 1: - # raise DuplicateRancherException() + if len(rancher) > 1: + raise DuplicateRancherException() if rancher.exists(): serializer = self.serializer_class(rancher.first()) diff --git a/apps/warehouse/web/api/v1/api.py b/apps/warehouse/web/api/v1/api.py index f80f854..721da69 100644 --- a/apps/warehouse/web/api/v1/api.py +++ b/apps/warehouse/web/api/v1/api.py @@ -135,8 +135,7 @@ class InventoryQuotaSaleTransactionViewSet(BaseViewSet, SoftDeleteMixin, Dynamic search_fields = [ 'rancher_fullname', 'rancher_mobile', 'pos_device__device_identity', 'pos_device__acceptor', 'pos_device__terminal', 'pos_device__serial', - 'items__gov_product__name', 'items__free_product__name', 'items__name', - 'items__item_type', 'items__unit', 'transaction_id', 'seller_organization__name', + 'transaction_id', 'seller_organization__name', 'quota_distribution__distribution_id', 'weight', 'delivery_address', 'transaction_price', 'price_paid', 'price_type', 'product_type', 'transactions_number', 'transaction_status', 'transaction_status_code', 'ref_num', 'terminal', 'payer_cart', 'transaction_date',