Compare commits
No commits in common. "896d66e8010d6e56b727360dd46b602a18437c05" and "af3b043a4624ebe2de1ff50abd2b28d339c04ff6" have entirely different histories.
896d66e801
...
af3b043a46
3 changed files with 3 additions and 12 deletions
|
@ -459,8 +459,7 @@
|
||||||
'id_national_code': customer.national_code,
|
'id_national_code': customer.national_code,
|
||||||
'id_card_number': customer.card_number,
|
'id_card_number': customer.card_number,
|
||||||
'id_account_number': customer.account_number,
|
'id_account_number': customer.account_number,
|
||||||
'id_address': customer.address,
|
'id_address': customer.address
|
||||||
'id_bank_name': customer.bank_name
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Loop through fields for easier maintenance
|
// Loop through fields for easier maintenance
|
||||||
|
@ -472,11 +471,6 @@
|
||||||
$('#exampleModalLabel').text('ویرایش کاربر');
|
$('#exampleModalLabel').text('ویرایش کاربر');
|
||||||
$('.data-submit').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
|
// Open modal
|
||||||
$('#add-new-record').offcanvas('show');
|
$('#add-new-record').offcanvas('show');
|
||||||
} else {
|
} else {
|
||||||
|
|
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
|
@ -3,7 +3,6 @@ from django.contrib.auth import get_user_model
|
||||||
from django.core.exceptions import ValidationError
|
from django.core.exceptions import ValidationError
|
||||||
from .models import Well, WaterMeterManufacturer
|
from .models import Well, WaterMeterManufacturer
|
||||||
from locations.models import Affairs, County, Broker
|
from locations.models import Affairs, County, Broker
|
||||||
from common.consts import UserRoles
|
|
||||||
|
|
||||||
|
|
||||||
class WaterMeterManufacturerForm(forms.ModelForm):
|
class WaterMeterManufacturerForm(forms.ModelForm):
|
||||||
|
@ -119,10 +118,8 @@ class WellForm(forms.ModelForm):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
# تنظیم querysetها - فقط کاربرانی که نقش مشترک دارند
|
# تنظیم querysetها
|
||||||
self.fields['representative'].queryset = get_user_model().objects.filter(
|
self.fields['representative'].queryset = get_user_model().objects.all()
|
||||||
profile__roles__slug=UserRoles.CUSTOMER.value
|
|
||||||
)
|
|
||||||
self.fields['water_meter_manufacturer'].queryset = WaterMeterManufacturer.objects.all()
|
self.fields['water_meter_manufacturer'].queryset = WaterMeterManufacturer.objects.all()
|
||||||
|
|
||||||
# اضافه کردن گزینه خالی
|
# اضافه کردن گزینه خالی
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue