diff --git a/exam/__manifest__.py b/exam/__manifest__.py
index 32d09163..57d5f81c 100644
--- a/exam/__manifest__.py
+++ b/exam/__manifest__.py
@@ -2,14 +2,14 @@
{
"name": "Exam Management for Education ERP",
- "version": "16.0.1.0.0",
+ "version": "17.0.1.0.0",
"author": "Serpent Consulting Services Pvt. Ltd.",
"website": "http://www.serpentcs.com",
"category": "School Management",
"license": "AGPL-3",
"summary": "A Module For Exams Management Taken In School",
"complexity": "easy",
- "images": ["static/description/exam_banner.png"],
+ "images": ["static/description/Banner_exam_17.png"],
"depends": ["school", "timetable"],
"data": [
"security/exam_security.xml",
diff --git a/exam/models/exam.py b/exam/models/exam.py
index 8764d595..2e222c8e 100644
--- a/exam/models/exam.py
+++ b/exam/models/exam.py
@@ -17,46 +17,40 @@ class StudentStudent(models.Model):
)
def set_alumni(self):
- """Override method to make exam results of student active false
- when student is alumni"""
+ """Override method to make exam results of student inactive
+ when student is marked as alumni."""
addexam_result_obj = self.env["additional.exam.result"]
regular_examresult_obj = self.env["exam.result"]
+
for rec in self:
- addexam_result_rec = addexam_result_obj.search(
- [("student_id", "=", rec.id)]
+ addexam_result_obj.search([("student_id", "=", rec.id)]).write(
+ {"active": False}
)
- regular_examresult_rec = regular_examresult_obj.search(
- [("student_id", "=", rec.id)]
+ regular_examresult_obj.search([("student_id", "=", rec.id)]).write(
+ {"active": False}
)
- if addexam_result_rec:
- addexam_result_rec.active = False
- if regular_examresult_rec:
- regular_examresult_rec.active = False
- return super(StudentStudent, self).set_alumni()
+
+ return super().set_alumni()
@api.model
def _search(
self,
- args,
+ domain,
offset=0,
limit=None,
order=None,
- count=False,
- access_rights_uid=None,
):
"""Override method to get exam of student selected."""
if self._context.get("exam"):
exam_obj = self.env["exam.exam"]
exam_rec = exam_obj.browse(self._context.get("exam"))
std_ids = [std_id.id for std_id in exam_rec.standard_id]
- args.append(("standard_id", "in", std_ids))
- return super(StudentStudent, self)._search(
- args=args,
+ domain.append(("standard_id", "in", std_ids))
+ return super()._search(
+ domain=domain,
offset=offset,
limit=limit,
order=order,
- count=count,
- access_rights_uid=access_rights_uid,
)
@@ -89,7 +83,7 @@ def unlink(self):
raise ValidationError(
_("You cannot delete schedule of exam which is in running!")
)
- return super(ExtendedTimeTable, self).unlink()
+ return super().unlink()
@api.constrains("exam_timetable_line_ids")
def _check_exam(self):
@@ -219,7 +213,8 @@ def check_exam_date(self):
raise ValidationError(
_(
f"{self.class_room_id.name} is occupied by \
- {record.name} for {record.standard_id.standard_id.name} class!"
+ {record.name} for \
+ {record.standard_id.standard_id.name} class!"
)
)
@@ -234,6 +229,10 @@ class ExamExam(models.Model):
def check_date_exam(self):
"""Method to check constraint of exam start date and end date."""
for rec in self:
+ if rec.start_date < fields.date.today():
+ raise ValidationError(
+ _("Exam date should be greater than today's date!")
+ )
if rec.end_date < rec.start_date:
raise ValidationError(
_("Exam end date should be greater than start date!")
@@ -299,7 +298,7 @@ def create(self, vals):
vals["exam_code"] = self.env["ir.sequence"].next_by_code("exam.exam") or _(
"New"
)
- return super(ExamExam, self).create(vals)
+ return super().create(vals)
def set_to_draft(self):
"""Method to set state to draft"""
@@ -445,7 +444,7 @@ def create(self, vals):
vals["addtional_exam_code"] = self.env["ir.sequence"].next_by_code(
"additional.exam"
) or _("New")
- return super(AdditionalExam, self).create(vals)
+ return super().create(vals)
@api.constrains("maximum_marks", "minimum_marks")
def check_marks(self):
@@ -574,13 +573,13 @@ def create(self, vals):
"""Inherited the create method to assign the roll no and std"""
if vals.get("student_id"):
vals.update(self._update_rollno_standard(vals.get("student_id")))
- return super(ExamResult, self).create(vals)
+ return super().create(vals)
def write(self, vals):
"""Inherited the write method to update the roll no and std"""
if vals.get("student_id"):
vals.update(self._update_rollno_standard(vals.get("student_id")))
- return super(ExamResult, self).write(vals)
+ return super().write(vals)
def unlink(self):
"""Inherited the unlink method to check the state at the deletion."""
@@ -589,7 +588,7 @@ def unlink(self):
raise ValidationError(
_("You can delete record in unconfirm state only!")
)
- return super(ExamResult, self).unlink()
+ return super().unlink()
@api.onchange("student_id")
def onchange_student(self):
@@ -790,13 +789,13 @@ def create(self, vals):
"""Override create method to get roll no and standard"""
if vals.get("student_id"):
self._update_student_vals(vals)
- return super(AdditionalExamResult, self).create(vals)
+ return super().create(vals)
def write(self, vals):
"""Override write method to get roll no and standard"""
if vals.get("student_id"):
self._update_student_vals(vals)
- return super(AdditionalExamResult, self).write(vals)
+ return super().write(vals)
@api.onchange("student_id")
def onchange_student(self):
diff --git a/exam/report/result_info.py b/exam/report/result_info.py
index d678efa5..1a3fb359 100644
--- a/exam/report/result_info.py
+++ b/exam/report/result_info.py
@@ -53,8 +53,8 @@ def _get_report_values(self, docids, data=None):
if not student_search or rec.state == "draft":
raise ValidationError(
_(
- """You cannot print report for student
-in unconfirm state or when data is not found !"""
+ "You cannot print report for student"
+ "in unconfirm state or when data is not found !"
)
)
return {
diff --git a/exam/static/description/Banner_exam_17.png b/exam/static/description/Banner_exam_17.png
new file mode 100644
index 00000000..90648c58
Binary files /dev/null and b/exam/static/description/Banner_exam_17.png differ
diff --git a/exam/static/description/icon.png b/exam/static/description/icon.png
index 815579db..aa47ee16 100644
Binary files a/exam/static/description/icon.png and b/exam/static/description/icon.png differ
diff --git a/exam/static/description/icon_old.png b/exam/static/description/icon_old.png
new file mode 100644
index 00000000..815579db
Binary files /dev/null and b/exam/static/description/icon_old.png differ
diff --git a/exam/static/description/index.html b/exam/static/description/index.html
index 00bd62c2..72fd4751 100644
--- a/exam/static/description/index.html
+++ b/exam/static/description/index.html
@@ -1,7 +1,7 @@
-
+
diff --git a/exam/views/exam_view.xml b/exam/views/exam_view.xml
index 68fc9e10..0205f32c 100644
--- a/exam/views/exam_view.xml
+++ b/exam/views/exam_view.xml
@@ -21,7 +21,7 @@
name="%(action_stu_result_form)d"
class="oe_inline oe_stat_button"
type="action"
- attrs="{'invisible':[('state', 'in', ['draft','terminate','alumni','cancel'])]}"
+ invisible="state in ['draft','terminate','alumni','cancel']"
groups="school.group_school_administration,school.group_school_teacher,school.group_school_student"
>
@@ -138,12 +138,13 @@
name="generate_result"
string="Generate result"
type="object"
- class="oe_stat_button fa fa-graduation-cap"
- attrs="{'invisible':[('state','in',['draft','running','cancelled'])]}"
+ class="oe_stat_button"
+ icon="fa-graduation-cap"
+ invisible="state in ['draft','running','cancelled']"
groups="school.group_school_teacher,school.group_school_administration"
/>
-
+
@@ -151,12 +152,12 @@
name="grade_system"
string="Grade System"
required="1"
- attrs="{'readonly': [('state','!=','draft')]}"
+ readonly="state != 'draft'"
widget="selection"
/>
@@ -165,7 +166,7 @@
@@ -191,8 +192,8 @@
name="standard_id"
nolabel="1"
colspan="4"
- attrs="{'readonly': [('state','!=','draft')]}"
- options="{"no_open": True, "no_create": True}"
+ readonly="state != 'draft'"
+ options="{'no_open': True, 'no_create': True}"
/>
@@ -200,25 +201,28 @@
name="exam_schedule_ids"
nolabel="1"
colspan="4"
- attrs="{'readonly': [('state','!=','draft')]}"
+ readonly="state != 'draft'"
context="{'default_standard_ids':standard_id,'academic_year':academic_year}"
>
-
+
@@ -226,11 +230,7 @@
-
+
- {'invisible': [('timetable_type','!=','regular')]}
+ timetable_type != 'regular'
@@ -320,7 +318,12 @@
-
+
@@ -550,7 +556,7 @@
name="student_id"
placeholder="Select Student"
context="{'exam':s_exam_ids}"
- options="{"no_create": True, "no_open": True}"
+ options="{'no_create': True, 'no_open': True}"
domain="[('state','!=','draft')]"
readonly="1"
/>
@@ -569,62 +575,65 @@
string="Grade System"
required="1"
widget="selection"
- attrs="{'readonly' : [('state','!=','draft')]}"
+ readonly="state != 'draft'"
/>
+