zhou #16

Merged
Ghost merged 2 commits from zhou into master 2026-08-07 12:14:41 +08:00
10 changed files with 144 additions and 4 deletions
+2 -1
View File
@@ -24,7 +24,7 @@
""",
'category': 'Education',
'sequence': 20,
'depends': ['base', 'web'],
'depends': ['base', 'web', 'mail'],
'external_dependencies': {
'python': ['pypinyin'],
},
@@ -40,6 +40,7 @@
'views/assignment_batch_wizard_views.xml',
'views/import_wizard_views.xml',
'views/homework_views.xml',
'views/training_views.xml',
'data/about_pages.xml',
'views/about_page_views.xml',
'views/menus.xml',
+1
View File
@@ -8,3 +8,4 @@ from . import assignment
from . import assignment_batch_wizard
from . import import_wizard
from . import about_page
from . import training
+1
View File
@@ -28,6 +28,7 @@ class SchoolCourse(models.Model):
_name = 'yuthon.school.course'
_description = '课程'
_inherit = ['mail.thread', 'mail.activity.mixin']
_order = 'semester, college, name'
name = fields.Char(string='课程名称', required=True, index=True)
+11
View File
@@ -0,0 +1,11 @@
from odoo import fields, models
class SchoolTraining(models.Model):
"""我的实训(占位模型)。"""
_name = 'yuthon.school.training'
_description = '我的实训'
name = fields.Char(string='实训名称', required=True)
note = fields.Text(string='备注')
+5 -2
View File
@@ -1,7 +1,7 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_yuthon_school_course_admin,yuthon.school.course.admin,model_yuthon_school_course,base.group_system,1,1,1,1
access_yuthon_school_course_teacher,yuthon.school.course.teacher,model_yuthon_school_course,college.group_teacher,1,1,1,1
access_yuthon_school_course_student,yuthon.school.course.student,model_yuthon_school_course,college.group_student,1,0,0,0
access_yuthon_school_course_student,yuthon.school.course.student,model_yuthon_school_course,college.group_student,1,1,0,0
access_yuthon_school_student_admin,yuthon.school.student.admin,model_yuthon_school_student,base.group_system,1,1,1,1
access_yuthon_school_student_teacher,yuthon.school.student.teacher,model_yuthon_school_student,college.group_teacher,1,1,1,1
access_yuthon_school_student_student,yuthon.school.student.student,model_yuthon_school_student,college.group_student,1,0,0,0
@@ -13,7 +13,7 @@ access_yuthon_school_class_teacher,yuthon.school.class.teacher,model_yuthon_scho
access_yuthon_school_class_student,yuthon.school.class.student,model_yuthon_school_class,college.group_student,1,0,0,0
access_yuthon_school_progress_admin,yuthon.school.progress.admin,model_yuthon_school_progress,base.group_system,1,1,1,1
access_yuthon_school_progress_teacher,yuthon.school.progress.teacher,model_yuthon_school_progress,college.group_teacher,1,1,1,1
access_yuthon_school_progress_student,yuthon.school.progress.student,model_yuthon_school_progress,college.group_student,1,0,0,0
access_yuthon_school_progress_student,yuthon.school.progress.student,model_yuthon_school_progress,college.group_student,1,1,0,0
access_yuthon_school_assignment_admin,yuthon.school.assignment.admin,model_yuthon_school_assignment,base.group_system,1,1,1,1
access_yuthon_school_assignment_teacher,yuthon.school.assignment.teacher,model_yuthon_school_assignment,college.group_teacher,1,1,1,1
access_yuthon_school_assignment_student,yuthon.school.assignment.student,model_yuthon_school_assignment,college.group_student,1,0,0,0
@@ -30,6 +30,9 @@ access_yuthon_school_course_chapter_student,yuthon.school.course.chapter.student
access_yuthon_school_course_chapter_attachment_admin,yuthon.school.course.chapter.attachment.admin,model_yuthon_school_course_chapter_attachment,base.group_system,1,1,1,1
access_yuthon_school_course_chapter_attachment_teacher,yuthon.school.course.chapter.attachment.teacher,model_yuthon_school_course_chapter_attachment,college.group_teacher,1,1,1,1
access_yuthon_school_course_chapter_attachment_student,yuthon.school.course.chapter.attachment.student,model_yuthon_school_course_chapter_attachment,college.group_student,1,0,0,0
access_yuthon_school_training_admin,yuthon.school.training.admin,model_yuthon_school_training,base.group_system,1,1,1,1
access_yuthon_school_training_teacher,yuthon.school.training.teacher,model_yuthon_school_training,college.group_teacher,1,1,1,1
access_yuthon_school_training_student,yuthon.school.training.student,model_yuthon_school_training,college.group_student,1,1,1,1
access_yuthon_about_page_admin,yuthon.about.page.admin,model_yuthon_about_page,base.group_system,1,1,1,1
access_yuthon_about_page_teacher,yuthon.about.page.teacher,model_yuthon_about_page,college.group_teacher,1,1,1,1
access_yuthon_about_page_student,yuthon.about.page.student,model_yuthon_about_page,college.group_student,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_yuthon_school_course_admin yuthon.school.course.admin model_yuthon_school_course base.group_system 1 1 1 1
3 access_yuthon_school_course_teacher yuthon.school.course.teacher model_yuthon_school_course college.group_teacher 1 1 1 1
4 access_yuthon_school_course_student yuthon.school.course.student model_yuthon_school_course college.group_student 1 0 1 0 0
5 access_yuthon_school_student_admin yuthon.school.student.admin model_yuthon_school_student base.group_system 1 1 1 1
6 access_yuthon_school_student_teacher yuthon.school.student.teacher model_yuthon_school_student college.group_teacher 1 1 1 1
7 access_yuthon_school_student_student yuthon.school.student.student model_yuthon_school_student college.group_student 1 0 0 0
13 access_yuthon_school_class_student yuthon.school.class.student model_yuthon_school_class college.group_student 1 0 0 0
14 access_yuthon_school_progress_admin yuthon.school.progress.admin model_yuthon_school_progress base.group_system 1 1 1 1
15 access_yuthon_school_progress_teacher yuthon.school.progress.teacher model_yuthon_school_progress college.group_teacher 1 1 1 1
16 access_yuthon_school_progress_student yuthon.school.progress.student model_yuthon_school_progress college.group_student 1 0 1 0 0
17 access_yuthon_school_assignment_admin yuthon.school.assignment.admin model_yuthon_school_assignment base.group_system 1 1 1 1
18 access_yuthon_school_assignment_teacher yuthon.school.assignment.teacher model_yuthon_school_assignment college.group_teacher 1 1 1 1
19 access_yuthon_school_assignment_student yuthon.school.assignment.student model_yuthon_school_assignment college.group_student 1 0 0 0
30 access_yuthon_school_course_chapter_attachment_admin yuthon.school.course.chapter.attachment.admin model_yuthon_school_course_chapter_attachment base.group_system 1 1 1 1
31 access_yuthon_school_course_chapter_attachment_teacher yuthon.school.course.chapter.attachment.teacher model_yuthon_school_course_chapter_attachment college.group_teacher 1 1 1 1
32 access_yuthon_school_course_chapter_attachment_student yuthon.school.course.chapter.attachment.student model_yuthon_school_course_chapter_attachment college.group_student 1 0 0 0
33 access_yuthon_school_training_admin yuthon.school.training.admin model_yuthon_school_training base.group_system 1 1 1 1
34 access_yuthon_school_training_teacher yuthon.school.training.teacher model_yuthon_school_training college.group_teacher 1 1 1 1
35 access_yuthon_school_training_student yuthon.school.training.student model_yuthon_school_training college.group_student 1 1 1 1
36 access_yuthon_about_page_admin yuthon.about.page.admin model_yuthon_about_page base.group_system 1 1 1 1
37 access_yuthon_about_page_teacher yuthon.about.page.teacher model_yuthon_about_page college.group_teacher 1 1 1 1
38 access_yuthon_about_page_student yuthon.about.page.student model_yuthon_about_page college.group_student 1 0 0 0
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

+1
View File
@@ -104,6 +104,7 @@
</list>
</field>
</sheet>
<chatter/>
</form>
</field>
</record>
+18
View File
@@ -1,4 +1,22 @@
<odoo>
<!-- ===================== 我的实训(顶级菜单,位于学习管理之上) ===================== -->
<menuitem id="menu_yuthon_training"
name="我的实训"
web_icon="college,static/src/img/training.png"
sequence="5"
action="action_yuthon_school_training"
groups="college.group_teacher,college.group_student,base.group_system"/>
<!-- ===================== 隐藏 Odoo 默认「讨论」菜单 ===================== -->
<record id="mail.menu_root_discuss" model="ir.ui.menu">
<field name="active" eval="False"/>
</record>
<!-- ===================== 隐藏 Odoo 默认「应用」菜单(模块安装器,师生不需要) ===================== -->
<record id="base.menu_management" model="ir.ui.menu">
<field name="active" eval="False"/>
</record>
<!-- ===================== 教育(根) ===================== -->
<menuitem id="menu_yuthon_education_root"
name="学习管理"
+46 -1
View File
@@ -12,6 +12,10 @@
<field name="res_model">yuthon.school.progress</field>
<field name="view_mode">kanban,list,form</field>
<field name="domain">['&amp;', ('student_id.user_id', '=', uid), ('course_id.state', '=', 'published')]</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'kanban', 'view_id': ref('yuthon_school_progress_view_kanban')}),
(0, 0, {'view_mode': 'list', 'view_id': ref('yuthon_school_progress_view_list')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('yuthon_school_progress_view_form_student')})]"/>
</record>
<!-- ===================== 学习进展:统一入口(按角色动态路由) ===================== -->
@@ -48,10 +52,11 @@ else:
</field>
</record>
<!-- ===================== 学习进展:表单 ===================== -->
<!-- ===================== 学习进展:表单(老师/管理员可编辑) ===================== -->
<record id="yuthon_school_progress_view_form" model="ir.ui.view">
<field name="name">yuthon.school.progress.form</field>
<field name="model">yuthon.school.progress</field>
<field name="groups_id" eval="[(4, ref('college.group_teacher')), (4, ref('base.group_system'))]"/>
<field name="arch" type="xml">
<form>
<sheet>
@@ -76,6 +81,46 @@ else:
</field>
</record>
<!-- ===================== 学习进展:表单(学生只读) ===================== -->
<record id="yuthon_school_progress_view_form_student" model="ir.ui.view">
<field name="name">yuthon.school.progress.form.student</field>
<field name="model">yuthon.school.progress</field>
<field name="priority">5</field>
<field name="groups_id" eval="[(4, ref('college.group_student'))]"/>
<field name="arch" type="xml">
<form edit="0" create="0" delete="0" duplicate="0">
<sheet>
<div class="oe_title">
<h1>
<field name="name" readonly="1"/>
</h1>
</div>
<group>
<group string="课程信息">
<field name="course_id" readonly="1"/>
<field name="teacher_id" readonly="1"/>
</group>
<group string="学习进度">
<field name="chapter_done" readonly="1"/>
<field name="chapter_total" readonly="1"/>
<field name="progress_rate" readonly="1"/>
<field name="status" readonly="1"/>
</group>
</group>
<group>
<group>
<field name="last_study_date" readonly="1"/>
<field name="score" readonly="1"/>
</group>
</group>
<group string="备注">
<field name="note" readonly="1" nolabel="1"/>
</group>
</sheet>
</form>
</field>
</record>
<!-- ===================== 学习进展:搜索 ===================== -->
<record id="yuthon_school_progress_view_search" model="ir.ui.view">
<field name="name">yuthon.school.progress.search</field>
+59
View File
@@ -0,0 +1,59 @@
<odoo>
<!-- ===================== 我的实训:看板(占位) ===================== -->
<record id="yuthon_school_training_view_kanban" model="ir.ui.view">
<field name="name">yuthon.school.training.kanban</field>
<field name="model">yuthon.school.training</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click" style="padding:12px 14px;">
<div class="o_kanban_record_headings">
<strong><field name="name"/></strong>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<!-- ===================== 我的实训:列表 ===================== -->
<record id="yuthon_school_training_view_list" model="ir.ui.view">
<field name="name">yuthon.school.training.list</field>
<field name="model">yuthon.school.training</field>
<field name="arch" type="xml">
<list>
<field name="name"/>
<field name="note"/>
</list>
</field>
</record>
<!-- ===================== 我的实训:表单 ===================== -->
<record id="yuthon_school_training_view_form" model="ir.ui.view">
<field name="name">yuthon.school.training.form</field>
<field name="model">yuthon.school.training</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="name"/>
<field name="note"/>
</group>
</sheet>
</form>
</field>
</record>
<!-- ===================== 我的实训:动作 ===================== -->
<record id="action_yuthon_school_training" model="ir.actions.act_window">
<field name="name">我的实训</field>
<field name="res_model">yuthon.school.training</field>
<field name="view_mode">kanban,list,form</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'kanban', 'view_id': ref('yuthon_school_training_view_kanban')}),
(0, 0, {'view_mode': 'list', 'view_id': ref('yuthon_school_training_view_list')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('yuthon_school_training_view_form')})]"/>
</record>
</odoo>