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, )