odoo_18_Education_management/models/schedule.py

54 lines
1.8 KiB
Python
Raw Normal View History

2025-07-29 05:25:05 +00:00
from odoo import models, fields
from odoo.exceptions import UserError
class SchoolClassSchedule(models.Model):
_name = 'school.class.schedule'
_description = 'Class Schedule'
title = fields.Char(string="Title", required=True)
class_name = fields.Char(string="Class")
subject = fields.Char(string="Subject")
teacher = fields.Char(string="Teacher")
secondary_teacher = fields.Char(string="Secondary Teacher")
start_date = fields.Date(string="Start From")
end_date = fields.Date(string="End Till")
total_class = fields.Integer(string="Total Classes")
total_enrollment = fields.Integer(string="Total Enrollments")
status = fields.Selection([
('draft', 'Draft'),
('active', 'Active'),
('completed', 'Completed'),
('cancelled', 'Cancelled')
], default='draft', string="Status")
school = fields.Char(string="School")
unit_credit = fields.Float(string="Unit Credit")
term = fields.Char(string="Term")
academic_year = fields.Char(string="Academic Year")
session = fields.Char(string="Session")
fees_structure = fields.Char(string="Fees Structure")
fees_status = fields.Selection([
('paid', 'Paid'),
('partial', 'Partial'),
('unpaid', 'Unpaid')
], string="Fees Status")
session_status = fields.Selection([
('planned', 'Planned'),
('running', 'Running'),
('ended', 'Ended')
], string="Session Status")
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)