diff --git a/college/__manifest__.py b/college/__manifest__.py index d5124d2..ef7efdd 100644 --- a/college/__manifest__.py +++ b/college/__manifest__.py @@ -64,7 +64,6 @@ 'college/static/src/js/hide_activity_menu.js', 'college/static/src/js/portal_indicator.js', 'college/static/src/xml/portal_indicator.xml', - 'college/static/src/xml/sidenav_tooltip.xml', ], 'web.assets_web_dark': [ 'college/static/src/scss/college_theme_dark.scss', diff --git a/college/data/about_pages.xml b/college/data/about_pages.xml index bf9ee19..f0d93f2 100644 --- a/college/data/about_pages.xml +++ b/college/data/about_pages.xml @@ -270,6 +270,7 @@ +

关于我们

diff --git a/college/models/exam.py b/college/models/exam.py index bab9d2f..6e5c063 100644 --- a/college/models/exam.py +++ b/college/models/exam.py @@ -107,11 +107,18 @@ class ExamQuestion(models.Model): @api.onchange('question_type') def _onchange_question_type(self): - """切换题型时:判断题给默认正确答案;单选/多选在无选项时补 A/B/C/D。""" + """切换题型时:判断题给默认正确答案;单选/多选在无选项时补 A/B/C/D; + 非选择题清掉默认带出的空选项,否则会被一并提交,触发 + ExamQuestionOption.content 的 required 校验。""" if self.question_type == 'true_false': self.correct_answer = 'True' - if self.question_type in ('single_choice', 'multiple_choice') and not self.option_ids: - self.option_ids = self._default_option_lines() + if self.question_type in ('single_choice', 'multiple_choice'): + if not self.option_ids: + self.option_ids = self._default_option_lines() + else: + # 切到填空/判断/简答:清掉默认带出的空选项,避免服务端必填校验报错 + # 用 (5,0,0) 完整写法,(5,) 简写在 Odoo 18 + Py3.13 下会触发访问冲突 + self.option_ids = [(5, 0, 0)] @api.depends('correct_answer') def _compute_correct_answer_tf(self): diff --git a/student_organization/models/student_organization.py b/student_organization/models/student_organization.py index 5e9eccd..7626e55 100644 --- a/student_organization/models/student_organization.py +++ b/student_organization/models/student_organization.py @@ -27,7 +27,9 @@ class StudentOrganization(models.Model): parent_path = fields.Char(index=True) # 完整名称(显示层级) - full_name = fields.Char(string='完整名称', compute='_compute_full_name', store=True) + # recursive=True: full_name 依赖 parent_id.full_name(自引用层级), + # 必须声明,否则 Odoo 18 报 UserWarning 且父级改名时子级不会重算 + full_name = fields.Char(string='完整名称', compute='_compute_full_name', store=True, recursive=True) # 负责人信息(学院用) manager_id = fields.Many2one('res.users', string='负责人')