27 lines
1.0 KiB
Python
27 lines
1.0 KiB
Python
from odoo import models, fields
|
|
from odoo.exceptions import UserError
|
|
import base64
|
|
|
|
class SchoolSubject(models.Model):
|
|
_name = 'school.subject'
|
|
_description = 'Subject'
|
|
|
|
name = fields.Char(string='Subject Name', required=True)
|
|
class_id = fields.Many2one('school.class', string='Class')
|
|
lesson_plan = fields.Text(string='Lesson Plan')
|
|
teacher = fields.Many2one('res.users', string='Teacher')
|
|
lesson_plan_line_ids = fields.One2many('school.subject.lesson', 'subject_id', string='Lesson Plans')
|
|
teacher_info_line_ids = fields.One2many('school.subject.teacher.info', 'subject_id', string="Teacher Info")
|
|
|
|
|
|
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) |