diff --git a/openeducat_core/models/student.py b/openeducat_core/models/student.py index fc0beeef..e6f4c00f 100644 --- a/openeducat_core/models/student.py +++ b/openeducat_core/models/student.py @@ -32,7 +32,7 @@ class OpStudentCourse(models.Model): student_id = fields.Many2one('op.student', 'Student', ondelete="cascade", tracking=True) course_id = fields.Many2one('op.course', 'Course', required=True, tracking=True) - batch_id = fields.Many2one('op.batch', 'Batch', required=True, tracking=True) + batch_id = fields.Many2one('op.batch', 'Batch', tracking=True) roll_number = fields.Char('Roll Number', tracking=True) subject_ids = fields.Many2many('op.subject', string='Subjects') academic_years_id = fields.Many2one('op.academic.year', 'Academic Year') @@ -119,7 +119,7 @@ def _onchange_name(self): @api.constrains('birth_date') def _check_birthdate(self): for record in self: - if record.birth_date > fields.Date.today(): + if record.birth_date and record.birth_date > fields.Date.today(): raise ValidationError(_( "Birth Date can't be greater than current date!")) diff --git a/openeducat_core/models/subject_registration.py b/openeducat_core/models/subject_registration.py index f2f72f73..17ed4cc1 100644 --- a/openeducat_core/models/subject_registration.py +++ b/openeducat_core/models/subject_registration.py @@ -33,7 +33,7 @@ class OpSubjectRegistration(models.Model): tracking=True) course_id = fields.Many2one('op.course', 'Course', required=True, tracking=True) - batch_id = fields.Many2one('op.batch', 'Batch', required=True, + batch_id = fields.Many2one('op.batch', 'Batch', tracking=True) compulsory_subject_ids = fields.Many2many( 'op.subject', 'subject_compulsory_rel', diff --git a/openeducat_core/views/student_course_view.xml b/openeducat_core/views/student_course_view.xml index 50856daf..6b3e0248 100644 --- a/openeducat_core/views/student_course_view.xml +++ b/openeducat_core/views/student_course_view.xml @@ -32,7 +32,7 @@ - + diff --git a/openeducat_core/views/student_view.xml b/openeducat_core/views/student_view.xml index 1219c78c..03fa53e6 100644 --- a/openeducat_core/views/student_view.xml +++ b/openeducat_core/views/student_view.xml @@ -114,7 +114,7 @@ - + @@ -127,7 +127,7 @@ - +