diff --git a/asset/models.py b/asset/models.py index 3be96c83c..171cbdc9b 100644 --- a/asset/models.py +++ b/asset/models.py @@ -18,7 +18,7 @@ class AssetCategory(models.Model): """ asset_category_name = models.CharField(max_length=255, unique=True) - asset_category_description = models.TextField() + asset_category_description = models.TextField(max_length=255) objects = models.Manager() company_id = models.ManyToManyField(Company,blank=True, verbose_name=_("Company")) @@ -32,7 +32,7 @@ class AssetLot(models.Model): """ lot_number = models.CharField(max_length=30, null=False, blank=False, unique=True) - lot_description = models.TextField(null=True, blank=True) + lot_description = models.TextField(null=True, blank=True,max_length=255) company_id = models.ManyToManyField(Company,blank=True, verbose_name=_("Company")) objects = HorillaCompanyManager() @@ -52,7 +52,7 @@ class Asset(models.Model): ] asset_name = models.CharField(max_length=255) owner = models.ForeignKey(Employee,on_delete=models.PROTECT,null=True,blank=True) - asset_description = models.TextField(null=True, blank=True) + asset_description = models.TextField(null=True, blank=True,max_length=255) asset_tracking_id = models.CharField(max_length=30, null=False, unique=True) asset_purchase_date = models.DateField() asset_purchase_cost = models.DecimalField(max_digits=10, decimal_places=2) @@ -127,7 +127,7 @@ class AssetAssignment(models.Model): Employee, on_delete=models.PROTECT, related_name="assigned_by" ) return_date = models.DateField(null=True, blank=True) - return_condition = models.TextField(null=True, blank=True) + return_condition = models.TextField(null=True, blank=True,max_length=255) return_status = models.CharField( choices=STATUS, max_length=30, null=True, blank=True ) @@ -159,7 +159,7 @@ class AssetRequest(models.Model): ) asset_category_id = models.ForeignKey(AssetCategory, on_delete=models.PROTECT) asset_request_date = models.DateField(auto_now_add=True) - description = models.TextField(null=True, blank=True) + description = models.TextField(null=True, blank=True,max_length=255) asset_request_status = models.CharField( max_length=30, choices=STATUS, default="Requested", null=True, blank=True ) diff --git a/attendance/models.py b/attendance/models.py index 7dc38a9d4..edcba8060 100644 --- a/attendance/models.py +++ b/attendance/models.py @@ -250,7 +250,7 @@ class Attendance(models.Model): is_validate_request_approved = models.BooleanField( default=False, verbose_name=_("Is validate request approved") ) - request_description = models.TextField(null=True) + request_description = models.TextField(null=True,max_length=255) request_type = models.CharField( max_length=18, null=True, choices=status, default="update_request" ) @@ -592,7 +592,7 @@ class AttendancerequestComment(models.Model): request_id = models.ForeignKey(Attendance, on_delete=models.CASCADE) employee_id = models.ForeignKey(Employee, on_delete=models.CASCADE) files = models.ManyToManyField(AttendancerequestFile, blank=True) - comment = models.TextField(null=True, verbose_name=_("Comment")) + comment = models.TextField(null=True, verbose_name=_("Comment"),max_length=255) created_at = models.DateTimeField( auto_now_add=True, verbose_name=_("Created At"), diff --git a/employee/models.py b/employee/models.py index 4e2f7e4f1..02745754a 100644 --- a/employee/models.py +++ b/employee/models.py @@ -549,7 +549,7 @@ class EmployeeBankDetails(models.Model): default="", ) branch = models.CharField(max_length=50) - address = models.TextField(max_length=300) + address = models.TextField(max_length=255) country = models.CharField(max_length=50, blank=True, null=True) state = models.CharField(max_length=50, blank=True) city = models.CharField(max_length=50, blank=True) @@ -591,7 +591,7 @@ class EmployeeNote(models.Model): related_name="employee_name", ) title = models.CharField(max_length=50, null=True, verbose_name=_("Title")) - description = models.TextField(verbose_name=_("Description")) + description = models.TextField(verbose_name=_("Description"),max_length=255) created_at = models.DateTimeField( auto_now_add=True, verbose_name=_("Created At"), @@ -620,7 +620,7 @@ class Policy(models.Model): """ title = models.CharField(max_length=50) - body = models.TextField() + body = models.TextField(max_length=255) is_visible_to_all = models.BooleanField(default=True) specific_employees = models.ManyToManyField(Employee, blank=True, editable=False) attachments = models.ManyToManyField(PolicyMultipleFile, blank=True) @@ -655,7 +655,7 @@ class BonusPoint(models.Model): max_length=100, choices=CONDITIONS, blank=True, null=True ) redeeming_points = models.IntegerField(blank=True, null=True) - reason = models.TextField(blank=True, null=True) + reason = models.TextField(blank=True, null=True,max_length=255) history = HorillaAuditLog( related_name="history_set", bases=[ @@ -704,7 +704,7 @@ class DisciplinaryAction(models.Model): employee_id = models.ManyToManyField(Employee) action = models.ForeignKey(Actiontype, on_delete=models.CASCADE) - description = models.TextField() + description = models.TextField(max_length=255) days = models.IntegerField(null=True, blank=True) start_date = models.DateField(null=True) attachment = models.FileField( diff --git a/helpdesk/models.py b/helpdesk/models.py index e0b9f1676..ecbebdb4c 100644 --- a/helpdesk/models.py +++ b/helpdesk/models.py @@ -89,7 +89,7 @@ class Ticket(models.Model): on_delete=models.PROTECT, verbose_name="Ticket Type", ) - description = models.TextField() + description = models.TextField(max_length=255) priority = models.CharField(choices = PRIORITY, max_length=100, default= "low") created_date = models.DateField(auto_now_add=True) resolved_date = models.DateField(blank=True, null=True) @@ -146,7 +146,7 @@ class Ticket(models.Model): class Comment(models.Model): - comment = models.TextField(null=True, blank=True) + comment = models.TextField(null=True, blank=True,max_length=255) ticket = models.ForeignKey(Ticket, on_delete=models.CASCADE, related_name="comment") employee_id = models.ForeignKey(Employee, on_delete=models.DO_NOTHING, related_name="employee_comment") date = models.DateTimeField(auto_now_add=True) @@ -194,7 +194,7 @@ class Attachment(models.Model): class FAQCategory(models.Model): title = models.CharField(max_length=30) - description = models.TextField(blank=True, null=True) + description = models.TextField(blank=True, null=True,max_length=255) def __str__(self): return self.title @@ -202,7 +202,7 @@ class FAQCategory(models.Model): class FAQ(models.Model): question = models.CharField(max_length=255) - answer=models.TextField() + answer=models.TextField(max_length=255) tags = models.ManyToManyField(Tags) category = models.ForeignKey(FAQCategory,on_delete=models.PROTECT) is_active = models.BooleanField(default=True) diff --git a/horilla_documents/models.py b/horilla_documents/models.py index 9cb5440ad..93e858469 100644 --- a/horilla_documents/models.py +++ b/horilla_documents/models.py @@ -43,7 +43,7 @@ class DocumentRequest(models.Model): employee_id = models.ManyToManyField(Employee) format = models.CharField(choices=FORMATS, max_length=10) max_size = models.IntegerField(blank=True, null=True) - description = models.TextField(blank=True, null=True) + description = models.TextField(blank=True, null=True,max_length=255) objects = HorillaCompanyManager() is_active = models.BooleanField(default=True) @@ -73,7 +73,7 @@ class Document(models.Model): ) document = models.FileField(upload_to="employee/documents", null=True) status = models.CharField(choices=STATUS, max_length=10, default="requested") - reject_reason = models.TextField(blank=True, null=True) + reject_reason = models.TextField(blank=True, null=True,max_length=255) is_active = models.BooleanField(default=True) expiry_date = models.DateField(null=True,blank=True) notify_before = models.IntegerField(default=1,null=True) diff --git a/leave/models.py b/leave/models.py index 30694f936..a3759e185 100644 --- a/leave/models.py +++ b/leave/models.py @@ -427,7 +427,7 @@ class LeaveRequest(models.Model): requested_days = models.FloatField( blank=True, null=True, verbose_name=_("Requested Days") ) - description = models.TextField(verbose_name=_("Description")) + description = models.TextField(verbose_name=_("Description"),max_length=255) attachment = models.FileField( null=True, blank=True, @@ -454,7 +454,7 @@ class LeaveRequest(models.Model): approved_available_days = models.FloatField(default=0) approved_carryforward_days = models.FloatField(default=0) created_at = models.DateTimeField(auto_now_add="True") - reject_reason = models.TextField(blank=True, verbose_name=_("Reject Reason")) + reject_reason = models.TextField(blank=True, verbose_name=_("Reject Reason"),max_length=255) history = HorillaAuditLog( related_name="history_set", bases=[ @@ -690,7 +690,7 @@ class LeaverequestComment(models.Model): request_id = models.ForeignKey(LeaveRequest, on_delete=models.CASCADE) employee_id = models.ForeignKey(Employee, on_delete=models.CASCADE) files = models.ManyToManyField(LeaverequestFile, blank=True) - comment = models.TextField(null=True, verbose_name=_("Comment")) + comment = models.TextField(null=True, verbose_name=_("Comment"),max_length=255) created_at = models.DateTimeField( auto_now_add=True, verbose_name=_("Created At"), @@ -717,7 +717,7 @@ class LeaveAllocationRequest(models.Model): null=True, related_name="leave_allocation_request_created", ) - description = models.TextField() + description = models.TextField(max_length=255) attachment = models.FileField( null=True, blank=True, upload_to="leave/leave_attachment" ) @@ -725,7 +725,7 @@ class LeaveAllocationRequest(models.Model): max_length=30, choices=LEAVE_ALLOCATION_STATUS, default="requested" ) created_at = models.DateTimeField(auto_now="True") - reject_reason = models.TextField(blank=True) + reject_reason = models.TextField(blank=True,max_length=255) history = HorillaAuditLog( related_name="history_set", bases=[ @@ -773,7 +773,7 @@ class LeaveallocationrequestComment(models.Model): request_id = models.ForeignKey(LeaveAllocationRequest, on_delete=models.CASCADE) employee_id = models.ForeignKey(Employee, on_delete=models.CASCADE) files = models.ManyToManyField(LeaverequestFile, blank=True) - comment = models.TextField(null=True, verbose_name=_("Comment")) + comment = models.TextField(null=True, verbose_name=_("Comment"),max_length=255) created_at = models.DateTimeField( auto_now_add=True, verbose_name=_("Created At"), diff --git a/offboarding/models.py b/offboarding/models.py index 849143901..85c5b06d5 100644 --- a/offboarding/models.py +++ b/offboarding/models.py @@ -21,7 +21,7 @@ class Offboarding(models.Model): statuses = [("ongoing", "Ongoing"), ("completed", "Completed")] title = models.CharField(max_length=20) - description = models.TextField() + description = models.TextField(max_length=255) managers = models.ManyToManyField(Employee) created_at = models.DateTimeField(auto_now_add=True) status = models.CharField(max_length=10, default="ongoing", choices=statuses) @@ -145,6 +145,7 @@ class ResignationLetter(models.Model): title = models.CharField(max_length=30, null=True) description = models.TextField( null=True, + max_length=255 ) planned_to_leave_on = models.DateField() status = models.CharField(max_length=10, choices=statuses, default="requested") @@ -245,7 +246,7 @@ class EmployeeTask(models.Model): ) status = models.CharField(max_length=10, choices=statuses, default="todo") task_id = models.ForeignKey(OffboardingTask, on_delete=models.CASCADE) - description = models.TextField(null=True, editable=False) + description = models.TextField(null=True, editable=False,max_length=255) history = HorillaAuditLog( related_name="history_set", bases=[ @@ -279,7 +280,7 @@ class ExitReason(models.Model): """ title = models.CharField(max_length=50) - description = models.TextField() + description = models.TextField(max_length=255) offboarding_employee_id = models.ForeignKey( OffboardingEmployee, on_delete=models.PROTECT ) @@ -295,7 +296,7 @@ class OffboardingNote(models.Model): OffboardingStageMultipleFile, blank=True, editable=False ) title = models.CharField(max_length=20, null=True) - description = models.TextField(null=True, blank=True) + description = models.TextField(null=True, blank=True,max_length=255) note_by = models.ForeignKey( Employee, on_delete=models.SET_NULL, null=True, editable=False ) diff --git a/onboarding/models.py b/onboarding/models.py index 3819ab090..f2adb9159 100644 --- a/onboarding/models.py +++ b/onboarding/models.py @@ -31,7 +31,7 @@ class OnboardingStage(models.Model): related_name="onboarding_stage", on_delete=models.CASCADE, ) - employee_id = models.ManyToManyField(Employee) + employee_id = models.ManyToManyField(Employee, verbose_name="Stage managers") sequence = models.IntegerField(null=True) is_final_stage = models.BooleanField(default=False) objects = HorillaCompanyManager("recruitment_id__company_id") diff --git a/payroll/models/models.py b/payroll/models/models.py index 8a3331fbf..b25d00ac1 100644 --- a/payroll/models/models.py +++ b/payroll/models/models.py @@ -99,6 +99,7 @@ class FilingStatus(models.Model): description = models.TextField( blank=True, verbose_name=_("Description"), + max_length=255, ) company_id = models.ForeignKey( Company, null=True, editable=False, on_delete=models.PROTECT @@ -238,7 +239,7 @@ class Contract(models.Model): validators=[min_zero], ) - note = models.TextField(null=True, blank=True) + note = models.TextField(null=True, blank=True,max_length=255) created_at = models.DateTimeField(auto_now_add=True, null=True) history = HorillaAuditLog( related_name="history_set", @@ -387,7 +388,7 @@ class WorkRecord(models.Model): ) at_work_second = models.IntegerField(null=True, blank=True, default=0) min_hour_second = models.IntegerField(null=True, blank=True, default=0) - note = models.TextField() + note = models.TextField(max_length=255) message = models.CharField(max_length=30, null=True, blank=True) is_attendance_record = models.BooleanField(default=False) is_leave_record = models.BooleanField(default=False) @@ -1396,7 +1397,7 @@ class LoanAccount(models.Model): allowance_id = models.ForeignKey( Allowance, on_delete=models.SET_NULL, editable=False, null=True ) - description = models.TextField(null=True) + description = models.TextField(null=True,max_length=255) deduction_ids = models.ManyToManyField(Deduction, editable=False) is_fixed = models.BooleanField(default=True, editable=False) rate = models.FloatField(default=0, editable=False) @@ -1569,7 +1570,7 @@ class Reimbursement(models.Model): related_name="approved_by", editable=False, ) - description = models.TextField(null=True) + description = models.TextField(null=True,max_length=255) allowance_id = models.ForeignKey( Allowance, on_delete=models.SET_NULL, null=True, editable=False ) @@ -1698,7 +1699,7 @@ class ReimbursementrequestComment(models.Model): request_id = models.ForeignKey(Reimbursement, on_delete=models.CASCADE) employee_id = models.ForeignKey(Employee, on_delete=models.CASCADE) - comment = models.TextField(null=True, verbose_name=_("Comment")) + comment = models.TextField(null=True, verbose_name=_("Comment"),max_length=255) created_at = models.DateTimeField( auto_now_add=True, verbose_name=_("Created At"), diff --git a/pms/models.py b/pms/models.py index e6ef62208..1c811b06f 100644 --- a/pms/models.py +++ b/pms/models.py @@ -37,7 +37,7 @@ class EmployeeObjective(models.Model): ("Not Started", _("Not Started")), ) objective = models.CharField(null=False, blank=False, max_length=100) - objective_description = models.TextField(blank=False, null=False) + objective_description = models.TextField(blank=False, null=False,max_length=255) created_at = models.DateField(auto_now_add=True) employee_id = models.ForeignKey( Employee, @@ -107,7 +107,7 @@ class EmployeeKeyResult(models.Model): ) key_result = models.CharField(max_length=60, null=True, blank=False) - key_result_description = models.TextField(blank=False, null=True) + key_result_description = models.TextField(blank=False, null=True,max_length=255) employee_objective_id = models.ForeignKey( EmployeeObjective, on_delete=models.CASCADE, related_name="emp_obj_id" ) @@ -318,7 +318,7 @@ class AnonymousFeedback(models.Model): anonymous_feedback_id = models.CharField( max_length=10, null=True, blank=False, editable=False ) - feedback_description = models.TextField(null=True, blank=True) + feedback_description = models.TextField(null=True, blank=True,max_length=255) def __str__(self) -> str: return f"Feedback based on a {self.based_on}"