52 lines
2.0 KiB
Python
52 lines
2.0 KiB
Python
from odoo import models, fields, api
|
|
|
|
class SchoolEnrollment(models.Model):
|
|
_name = 'school.enrollment'
|
|
_description = 'Enrollment'
|
|
|
|
|
|
# Relations
|
|
application_id = fields.Many2one('school.application', string="Application", required=True)
|
|
student_id = fields.Many2one('res.partner', string='Student', required=True)
|
|
school_id = fields.Many2one('res.company', string="School", default=lambda self: self.env.company)
|
|
|
|
# Basic Info
|
|
image = fields.Binary("Profile Photo", store=True)
|
|
class_name = fields.Selection([
|
|
('1', 'Class 1'), ('2', 'Class 2'), ('3', 'Class 3'),
|
|
('4', 'Class 4'), ('5', 'Class 5'), ('6', 'Class 6'),
|
|
('7', 'Class 7'), ('8', 'Class 8'), ('9', 'Class 9'),
|
|
('10', 'Class 10'), ('11', 'Class 11'), ('12', 'Class 12'),
|
|
], string="Class", required=True)
|
|
|
|
course = fields.Char(string="Course")
|
|
session = fields.Char(string="Session")
|
|
academic_year = fields.Char(string="Academic Year")
|
|
enrollment_date = fields.Date(string="Enrollment Date")
|
|
|
|
# Fee Info
|
|
fees_structure = fields.Char(string="Fees Structure")
|
|
fees_status = fields.Selection([
|
|
('paid', 'Paid'),
|
|
('partial', 'Partially Paid'),
|
|
('unpaid', 'Unpaid')
|
|
], string="Fees Status", default="unpaid")
|
|
|
|
session_status = fields.Selection([
|
|
('active', 'Active'),
|
|
('completed', 'Completed'),
|
|
('drop', 'Dropped')
|
|
], string="Session Status", default="active")
|
|
|
|
status = fields.Selection([
|
|
('draft', 'Draft'),
|
|
('confirmed', 'Confirmed'),
|
|
('cancelled', 'Cancelled')
|
|
], string="Status", default='draft')
|
|
|
|
# Linked lines
|
|
subject_line_ids = fields.One2many('school.enrollment.subject', 'enrollment_id', string="Subjects")
|
|
fee_summary_line_ids = fields.One2many('school.enrollment.fee.summary', 'enrollment_id', string="Fee Summary")
|
|
|
|
course_id = fields.Many2one('school.course', string='Course', ondelete='cascade', required=True)
|