Change installation field.

This commit is contained in:
aminhashemi92 2025-11-23 14:14:52 +03:30
parent 18f37ab513
commit a8882ddf39
10 changed files with 147 additions and 258 deletions

View file

@ -20,11 +20,12 @@ class InstallationReportForm(forms.ModelForm):
model = InstallationReport
fields = [
'visited_date', 'new_water_meter_serial', 'seal_number',
'utm_x', 'utm_y', 'meter_type', 'meter_size', 'meter_model',
'utm_x', 'utm_y', 'meter_type',
'discharge_pipe_diameter', 'usage_type', 'exploitation_license_number',
'motor_power', 'flow_rate', 'meter_reading', 'meter_charge', 'meter_charge_expiration_date',
'is_panel_sealed', 'is_panel_cut', 'is_disconnection_done',
'water_meter_manufacturer', 'sim_number', 'driving_force',
'motor_power', 'flow_rate', 'meter_charge_expiration_date',
'pump_type', 'licence_working_hour',
'is_panel_cut',
'water_meter_manufacturer',
'is_meter_suspicious', 'description'
]
@ -60,16 +61,7 @@ class InstallationReportForm(forms.ModelForm):
('smart', 'هوشمند (آب و برق)'),
('volumetric', 'حجمی')
]),
'meter_size': forms.TextInput(attrs={
'class': 'form-control'
}),
'meter_model': forms.Select(attrs={
'class': 'form-select'
}, choices=[
('', 'انتخاب کنید'),
('direct', 'مستقیم'),
('indirect', 'غیرمستقیم')
]),
# meter_size and meter_model removed from form UI
'discharge_pipe_diameter': forms.NumberInput(attrs={
'class': 'form-control',
'required': True
@ -96,16 +88,7 @@ class InstallationReportForm(forms.ModelForm):
'min': '0',
'step': '0.0001',
}),
'meter_reading': forms.NumberInput(attrs={
'class': 'form-control',
'min': '0',
'step': '0.0001',
}),
'meter_charge': forms.NumberInput(attrs={
'class': 'form-control',
'min': '0',
'step': '0.0001',
}),
# meter_reading and meter_charge removed from form UI
'meter_charge_expiration_date': forms.DateInput(attrs={
'type': 'date',
'class': 'form-control',
@ -115,27 +98,26 @@ class InstallationReportForm(forms.ModelForm):
'id': 'id_water_meter_manufacturer',
'required': True
}),
'sim_number': forms.TextInput(attrs={
'class': 'form-control',
# sim_number and driving_force removed from form UI
'pump_type': forms.Select(attrs={
'class': 'form-select',
'required': True
}),
'driving_force': forms.TextInput(attrs={
'licence_working_hour': forms.NumberInput(attrs={
'class': 'form-control',
'min': '0',
'step': '1',
'required': True
}),
'is_meter_suspicious': forms.CheckboxInput(attrs={
'class': 'form-check-input',
'id': 'id_is_meter_suspicious',
}),
'is_panel_sealed': forms.CheckboxInput(attrs={
'class': 'form-check-input',
}),
# is_panel_sealed removed from form UI
'is_panel_cut': forms.CheckboxInput(attrs={
'class': 'form-check-input',
}),
'is_disconnection_done': forms.CheckboxInput(attrs={
'class': 'form-check-input',
}),
# is_disconnection_done removed from form UI
'description': forms.Textarea(attrs={
'class': 'form-control',
'rows': 3
@ -144,27 +126,22 @@ class InstallationReportForm(forms.ModelForm):
labels = {
'visited_date': 'تاریخ مراجعه',
'new_water_meter_serial': 'سریال کنتور جدید',
'new_water_meter_serial': 'سریال کنتور',
'seal_number': 'شماره پلمپ',
'utm_x': 'UTM X',
'utm_y': 'UTM Y',
'meter_type': 'نوع کنتور',
'meter_size': 'سایز کنتور',
'discharge_pipe_diameter': 'قطر لوله آبده (اینچ)',
'usage_type': 'نوع مصرف',
'exploitation_license_number': 'شماره پروانه بهره‌برداری',
'motor_power': 'قدرت موتور (کیلووات ساعت)',
'flow_rate': 'دبی (لیتر بر ثانیه)',
'meter_reading': 'عدد کنتور (متر مکعب)',
'meter_charge': 'شارژ کنتور (متر مکعب)',
'motor_power': 'توان مصرفی (کیلووات)',
'flow_rate': 'دبی بعد از کالیبراسیون (لیتر بر ثانیه)',
'meter_charge_expiration_date': 'تاریخ پایان اعتبار شارژ',
'pump_type': 'نوع پمپ',
'licence_working_hour': 'ساعت کارکرد پروانه',
'water_meter_manufacturer': 'شرکت سازنده کنتور',
'sim_number': 'شماره سیمکارت',
'driving_force': 'نیرو محرکه چاه',
'is_meter_suspicious': 'کنتور مشکوک است',
'is_panel_sealed': 'پلمپ تابلو',
'is_panel_cut': 'تابلو قطع',
'is_disconnection_done': 'انجام عملیات قطع',
'description': 'توضیحات'
}