diff --git a/accounts/templates/accounts/customer_list.html b/accounts/templates/accounts/customer_list.html index 38f2fcc..1b7e103 100644 --- a/accounts/templates/accounts/customer_list.html +++ b/accounts/templates/accounts/customer_list.html @@ -459,8 +459,7 @@ 'id_national_code': customer.national_code, 'id_card_number': customer.card_number, 'id_account_number': customer.account_number, - 'id_address': customer.address, - 'id_bank_name': customer.bank_name + 'id_address': customer.address }; // Loop through fields for easier maintenance @@ -472,11 +471,6 @@ $('#exampleModalLabel').text('ویرایش کاربر'); $('.data-submit').text('ویرایش'); - // Ensure select value is applied (for some browsers/plugins) - if (customer.bank_name !== undefined && customer.bank_name !== null) { - $('#id_bank_name').val(customer.bank_name); - } - // Open modal $('#add-new-record').offcanvas('show'); } else { diff --git a/db.sqlite3 b/db.sqlite3 index 0bbaaf8..a9d6a51 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/wells/forms.py b/wells/forms.py index e04ecc5..5f39178 100644 --- a/wells/forms.py +++ b/wells/forms.py @@ -3,7 +3,6 @@ from django.contrib.auth import get_user_model from django.core.exceptions import ValidationError from .models import Well, WaterMeterManufacturer from locations.models import Affairs, County, Broker -from common.consts import UserRoles class WaterMeterManufacturerForm(forms.ModelForm): @@ -119,10 +118,8 @@ class WellForm(forms.ModelForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - # تنظیم queryset‌ها - فقط کاربرانی که نقش مشترک دارند - self.fields['representative'].queryset = get_user_model().objects.filter( - profile__roles__slug=UserRoles.CUSTOMER.value - ) + # تنظیم queryset‌ها + self.fields['representative'].queryset = get_user_model().objects.all() self.fields['water_meter_manufacturer'].queryset = WaterMeterManufacturer.objects.all() # اضافه کردن گزینه خالی