Files
Odoo-Tutorial/education/models/education_class.py
T

30 lines
1.0 KiB
Python
Raw Normal View History

2025-02-21 18:00:17 +07:00
# -*- coding: utf-8 -*-
from odoo import models, fields
2025-02-22 10:32:13 +07:00
2025-02-21 18:00:17 +07:00
class EducationClass(models.Model):
2025-02-22 10:32:13 +07:00
_name = "education.class"
_description = "Education Class"
name = fields.Char(string="Name", required=True)
class_group_id = fields.Many2one(
"education.class.group", string="Class Group", ondelete="restrict"
)
next_class_id = fields.Many2one("education.class", string="Next Class")
2025-02-21 18:00:17 +07:00
2025-02-22 10:32:13 +07:00
attachment_ids = fields.Many2many(
"ir.attachment",
"education_student_ir_attachment_rel",
"attachment_id",
"student_id",
string="Attachments",
)
2025-02-21 18:00:17 +07:00
2025-02-22 10:32:13 +07:00
currency_id = fields.Many2one("res.currency", string="Currency")
class_fund = fields.Monetary(string="Class Fund", currency_field="currency_id")
student_ids = fields.One2many("education.student", "class_id", string="Students")
school_id = fields.Many2one("education.school", string="School", required=True)
active = fields.Boolean(string="Active", default=True)
teacher_ids = fields.Many2many("res.partner", string="Teachers")