fix: service unit validation and translation
This commit is contained in:
		
							parent
							
								
									f579680b97
								
							
						
					
					
						commit
						ccbdfcbed1
					
				| @ -12,12 +12,14 @@ class HealthcareServiceUnitType(Document): | ||||
| 	def validate(self): | ||||
| 		if self.allow_appointments and self.inpatient_occupancy: | ||||
| 			frappe.msgprint( | ||||
| 				_('Healthcare Service Unit Type cannot be both <b>Allow Appointments</b> and <b>Inpatient Occupancy</b>'), | ||||
| 				_('Healthcare Service Unit Type cannot have both {0} and {1}').format( | ||||
| 					frappe.bold('Allow Appointments'), frappe.bold('Inpatient Occupancy')), | ||||
| 				raise_exception=1, title=_('Validation Error'), indicator='red' | ||||
| 			) | ||||
| 		elif not self.allow_appointments and not self.inpatient_occupancy: | ||||
| 			frappe.msgprint( | ||||
| 				_('Healthcare Service Unit Type cannot be both <b>Allow Appointments</b> and <b>Inpatient Occupancy</b>'), | ||||
| 				_('Healthcare Service Unit Type must allow atleast one among {0} and {1}').format( | ||||
| 					frappe.bold('Allow Appointments'), frappe.bold('Inpatient Occupancy')), | ||||
| 				raise_exception=1, title=_('Validation Error'), indicator='red' | ||||
| 			) | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user