25 lines
1.2 KiB
Python
25 lines
1.2 KiB
Python
from odoo import models, fields
|
|
|
|
|
|
class SchoolCourse(models.Model):
|
|
_name = 'school.course'
|
|
_description = 'Course'
|
|
|
|
application_id = fields.Many2one('school.application', string="Student", required=True)
|
|
name = fields.Char(string='Course Name', required=True)
|
|
class_id = fields.Many2one('school.class', string='Class')
|
|
teacher = fields.Many2one('res.users', string='Teacher')
|
|
student_name = fields.Char(related='application_id.name', string="Student Name", store=True)
|
|
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')
|
|
|
|
|
|
|
|
|