39 lines
1.3 KiB
Python
39 lines
1.3 KiB
Python
from odoo import models, fields
|
|
from odoo.exceptions import UserError
|
|
_inherit = ['mail.thread', 'mail.activity.mixin']
|
|
|
|
class SchoolCourseSchedule(models.Model):
|
|
_name = 'school.course.schedule'
|
|
_description = 'Weekly Schedule'
|
|
|
|
course_id = fields.Many2one('school.course', string='Course', ondelete='cascade')
|
|
schedule_time = fields.Char(string='Schedule Time')
|
|
day = fields.Selection([
|
|
('mon', 'Monday'),
|
|
('tue', 'Tuesday'),
|
|
('wed', 'Wednesday'),
|
|
('thu', 'Thursday'),
|
|
('fri', 'Friday'),
|
|
('sat', 'Saturday'),
|
|
('sun', 'Sunday'),
|
|
], string='Day')
|
|
location = fields.Char(string='Location')
|
|
period = fields.Char(string='Period')
|
|
status = fields.Selection([
|
|
('planned', 'Planned'),
|
|
('ongoing', 'Ongoing'),
|
|
('completed', 'Completed')
|
|
], string='Status', default='planned')
|
|
|
|
|
|
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) |