odoo_18_Education_management/models/school_course.py

25 lines
1.2 KiB
Python
Raw Normal View History

2025-07-29 05:25:05 +00:00
from odoo import models, fields
class SchoolCourse(models.Model):
_name = 'school.course'
_description = 'Course'
2025-08-04 07:27:45 +00:00
application_id = fields.Many2one('school.application', string="Student", required=True)
2025-07-29 05:25:05 +00:00
name = fields.Char(string='Course Name', required=True)
class_id = fields.Many2one('school.class', string='Class')
teacher = fields.Many2one('res.users', string='Teacher')
2025-08-04 07:27:45 +00:00
student_name = fields.Char(related='application_id.name', string="Student Name", store=True)
2025-07-29 05:25:05 +00:00
start_date = fields.Date(string='Started On')
end_date = fields.Date(string='End Date')
total_capacity = fields.Integer(string='Total Capacity')
unit_credit = fields.Float(string='Unit Credit')
attendance_ids = fields.One2many('school.course.attendance', 'course_id', string='Attendance')
enrolled_student_ids = fields.One2many('school.course.student', 'course_id', string='Enrolled Students')
attendance_ids = fields.One2many('school.course.attendance', 'course_id', string='Attendance')
schedule_line_ids = fields.One2many('school.course.schedule', 'course_id', string='Weekly Schedule')
assignment_ids = fields.One2many('school.course.assignment', 'course_id', string='Assignments')
2025-08-04 07:27:45 +00:00