Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIG] [17.0] Timetable : Migrated into 17.0 #285

Open
wants to merge 3 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions timetable/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

{
"name": "Timetable Management",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"author": "Serpent Consulting Services Pvt. Ltd.,\
Odoo Community Association (OCA)",
"website": "http://www.serpentcs.com",
"license": "AGPL-3",
"category": "School Management",
"complexity": "easy",
"summary": "A Module For Timetable Management In School",
"images": ["static/description/SchoolTimetable.png"],
"images": ["static/description/Banner_timetable_17.png"],
"depends": ["school"],
"data": [
"security/timetable_security.xml",
Expand Down
18 changes: 8 additions & 10 deletions timetable/models/timetable.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _compute_user(self):
[("regular", "Regular")],
"Time Table Type",
default="regular",
invisible=True,
# invisible=True,
help="Select time table type",
)
user_ids = fields.Many2many(
Expand All @@ -64,6 +64,7 @@ def _check_timetable(self):
("year_id", "=", record.year_id.id),
("standard_id", "=", record.standard_id.id),
("id", "!=", record.id), # Exclude the current record
("timetable_type", "=", record.timetable_type),
]
)
if existing_records:
Expand Down Expand Up @@ -93,7 +94,8 @@ def _check_lecture(self):
raise ValidationError(
_(
f"You cannot set lecture at same time {rec.start_time}"
f"at same day {rec.week_day} for teacher {rec.teacher_id.name}.!"
f"at same day {rec.week_day}"
f"for teacher {rec.teacher_id.name}.!"
)
)
# Checks if time is greater than 24 hours than raise error
Expand Down Expand Up @@ -225,25 +227,21 @@ class SubjectSubject(models.Model):
@api.model
def _search(
self,
args,
domain,
offset=0,
limit=None,
order=None,
count=False,
access_rights_uid=None,
):
"""Override method to get subject related to teacher."""
teacher_id = self._context.get("teacher_id")
if teacher_id:
for teacher_data in self.env["school.teacher"].browse(teacher_id):
args.append(("teacher_ids", "in", [teacher_data.id]))
return super(SubjectSubject, self)._search(
args=args,
domain.append(("teacher_ids", "in", [teacher_data.id]))
return super()._search(
domain=domain,
offset=offset,
limit=limit,
order=order,
count=count,
access_rights_uid=access_rights_uid,
)

@api.constrains("minimum_marks")
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified timetable/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added timetable/static/description/icon_old.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion timetable/tests/test_timetable.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class TestTimetable(common.TransactionCase):
def setUp(self):
super(TestTimetable, self).setUp()
super().setUp()
self.time_table_obj = self.env["time.table"]
self.time_table_line_obj = self.env["time.table.line"]
self.stander_id = self.env.ref("school.demo_standard_standard_2")
Expand Down
6 changes: 3 additions & 3 deletions timetable/views/timetable_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/>
<field
name="class_room_id"
options="{&quot;no_create&quot;: True}"
options="{'no_create': True}"
invisible="1"
/>
<field name="user_ids" invisible="1" />
Expand Down Expand Up @@ -111,12 +111,12 @@
groups="school.group_school_administration,school.group_school_teacher,school.group_school_student,school.group_school_parent"
sequence="1"
/>
<menuitem
<!-- <menuitem
id="menu_timetable_regular"
name="Regular Timetable"
parent="menu_timetable_1"
action="action_timetable_regular"
groups="school.group_school_administration,school.group_school_teacher,school.group_school_student,school.group_school_parent"
sequence="61"
/>
/> -->
</odoo>