diff --git a/college/__manifest__.py b/college/__manifest__.py index 74d85fc..e47bcbb 100644 --- a/college/__manifest__.py +++ b/college/__manifest__.py @@ -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', diff --git a/college/models/__init__.py b/college/models/__init__.py index 4cddd08..2a892f2 100644 --- a/college/models/__init__.py +++ b/college/models/__init__.py @@ -8,3 +8,4 @@ from . import assignment from . import assignment_batch_wizard from . import import_wizard from . import about_page +from . import training diff --git a/college/models/course.py b/college/models/course.py index f4d92c7..ea5e44f 100644 --- a/college/models/course.py +++ b/college/models/course.py @@ -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) diff --git a/college/models/training.py b/college/models/training.py new file mode 100644 index 0000000..64b74fe --- /dev/null +++ b/college/models/training.py @@ -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='备注') \ No newline at end of file diff --git a/college/security/ir.model.access.csv b/college/security/ir.model.access.csv index 02de7fe..c5de095 100644 --- a/college/security/ir.model.access.csv +++ b/college/security/ir.model.access.csv @@ -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 diff --git a/college/static/src/img/training.png b/college/static/src/img/training.png new file mode 100644 index 0000000..b84234a Binary files /dev/null and b/college/static/src/img/training.png differ diff --git a/college/views/chapter_views.xml b/college/views/chapter_views.xml index f97563e..16af63f 100644 --- a/college/views/chapter_views.xml +++ b/college/views/chapter_views.xml @@ -104,6 +104,7 @@ + diff --git a/college/views/menus.xml b/college/views/menus.xml index da26bd1..d9eac79 100644 --- a/college/views/menus.xml +++ b/college/views/menus.xml @@ -1,4 +1,22 @@ + + + + + + + + + + + + + yuthon.school.progress kanban,list,form ['&', ('student_id.user_id', '=', uid), ('course_id.state', '=', 'published')] + @@ -48,10 +52,11 @@ else: - + yuthon.school.progress.form yuthon.school.progress +
@@ -76,6 +81,46 @@ else: + + + yuthon.school.progress.form.student + yuthon.school.progress + 5 + + + + +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ yuthon.school.progress.search diff --git a/college/views/training_views.xml b/college/views/training_views.xml new file mode 100644 index 0000000..fdf671a --- /dev/null +++ b/college/views/training_views.xml @@ -0,0 +1,59 @@ + + + + yuthon.school.training.kanban + yuthon.school.training + + + + +
+
+ +
+
+
+
+
+
+
+ + + + yuthon.school.training.list + yuthon.school.training + + + + + + + + + + + yuthon.school.training.form + yuthon.school.training + +
+ + + + + + +
+
+
+ + + + 我的实训 + yuthon.school.training + kanban,list,form + + +
\ No newline at end of file