shcool/school/models/yuthon_school_syllabus.py
2026-08-03 12:03:31 +08:00

47 lines
1.1 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from odoo import fields, models, api
class Syllabus(models.Model):
_name = 'yuthon.school.syllabus'
_description = '课程大纲'
_order = 'sequence, id'
name = fields.Char(
string='大纲条目',
required=True,
help='如:模块开发与权限设计',
)
sequence = fields.Integer(
string='排序',
default=10,
)
week = fields.Char(
string='周次',
help='如:第 1 周',
)
course_id = fields.Many2one(
'yuthon.school.course',
string='所属课程',
required=True,
ondelete='cascade',
)
chapter_ids = fields.Many2many(
'yuthon.school.chapter',
'yuthon_syllabus_chapter_rel',
'syllabus_id', 'chapter_id',
string='覆盖章节',
help='本条目对应的教材章节Many2many 演示)',
)
objective = fields.Text(
string='教学目标',
help='学完本条目应掌握的能力',
)
content = fields.Html(
string='大纲内容',
sanitize=True,
)
active = fields.Boolean(
string='启用',
default=True,
)