47 lines
2.0 KiB
Python
47 lines
2.0 KiB
Python
from odoo import models, fields
|
|
from odoo.exceptions import UserError
|
|
|
|
class SchoolEnrollment(models.Model):
|
|
_name = 'school.enrollment'
|
|
_description = 'Enrollment'
|
|
|
|
student_id = fields.Many2one('school.application', string="Student", ondelete='set null')
|
|
image = fields.Binary(string="Profile Photo")
|
|
school_name = fields.Char(string="School")
|
|
class_name = fields.Char(string="Class")
|
|
course = fields.Char(string="Course")
|
|
session = fields.Char(string="Session")
|
|
academic_year = fields.Char(string="Academic Year")
|
|
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")
|
|
enrollment_date = fields.Date(string="Enrollment Date")
|
|
status = fields.Selection([
|
|
('draft', 'Draft'),
|
|
('confirmed', 'Confirmed'),
|
|
('cancelled', 'Cancelled')
|
|
], string="Status", default='draft')
|
|
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)
|
|
student_id = fields.Many2one('res.partner', string='Student', required=True)
|
|
|
|
def action_send_message(self):
|
|
for record in self:
|
|
raise UserError("Send Message clicked for %s" % record.name)
|
|
|
|
def action_log_note(self):
|
|
for record in self:
|
|
raise UserError("Log Note clicked for %s" % record.name)
|
|
|
|
def action_schedule_activity(self):
|
|
for record in self:
|
|
raise UserError("Activity clicked for %s" % record.name) |