commit 3ae0293647a46c277068f7f498e1e54cadb4f254 Author: Victor Date: Fri Mar 13 18:31:37 2026 +0100 Primeira fase do projeto diff --git a/.__manifest__.py.swp b/.__manifest__.py.swp new file mode 100644 index 0000000..45eff17 Binary files /dev/null and b/.__manifest__.py.swp differ diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/__manifest__.py b/__manifest__.py new file mode 100644 index 0000000..3bb458c --- /dev/null +++ b/__manifest__.py @@ -0,0 +1,17 @@ +{ + 'name': 'Gestao Escolar', + 'version': '1.0', + 'summary': 'Sistema de Gestão Escolar', + 'author': 'Sebastiao', + 'category': 'Education', + 'depends': ['base'], + + 'data': [ + 'security/groups.xml', + 'security/ir.model.access.csv', + 'views/school_views.xml', + ], + + 'installable': True, + 'application': True, +} diff --git a/__pycache__/__init__.cpython-313.pyc b/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000..58bcd69 Binary files /dev/null and b/__pycache__/__init__.cpython-313.pyc differ diff --git a/models/__init__.py b/models/__init__.py new file mode 100644 index 0000000..a2369d6 --- /dev/null +++ b/models/__init__.py @@ -0,0 +1,7 @@ +from . import student +from . import teacher +from . import academic_year +from . import school_class +from . import subject +from . import enrollment +from . import assessment diff --git a/models/__pycache__/__init__.cpython-313.pyc b/models/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000..31f2ca5 Binary files /dev/null and b/models/__pycache__/__init__.cpython-313.pyc differ diff --git a/models/__pycache__/academic_year.cpython-313.pyc b/models/__pycache__/academic_year.cpython-313.pyc new file mode 100644 index 0000000..33a702b Binary files /dev/null and b/models/__pycache__/academic_year.cpython-313.pyc differ diff --git a/models/__pycache__/assessment.cpython-313.pyc b/models/__pycache__/assessment.cpython-313.pyc new file mode 100644 index 0000000..5215691 Binary files /dev/null and b/models/__pycache__/assessment.cpython-313.pyc differ diff --git a/models/__pycache__/enrollment.cpython-313.pyc b/models/__pycache__/enrollment.cpython-313.pyc new file mode 100644 index 0000000..25ff4bc Binary files /dev/null and b/models/__pycache__/enrollment.cpython-313.pyc differ diff --git a/models/__pycache__/school_class.cpython-313.pyc b/models/__pycache__/school_class.cpython-313.pyc new file mode 100644 index 0000000..a1e05ec Binary files /dev/null and b/models/__pycache__/school_class.cpython-313.pyc differ diff --git a/models/__pycache__/student.cpython-313.pyc b/models/__pycache__/student.cpython-313.pyc new file mode 100644 index 0000000..469bc87 Binary files /dev/null and b/models/__pycache__/student.cpython-313.pyc differ diff --git a/models/__pycache__/subject.cpython-313.pyc b/models/__pycache__/subject.cpython-313.pyc new file mode 100644 index 0000000..ea9660d Binary files /dev/null and b/models/__pycache__/subject.cpython-313.pyc differ diff --git a/models/__pycache__/teacher.cpython-313.pyc b/models/__pycache__/teacher.cpython-313.pyc new file mode 100644 index 0000000..6ef9f41 Binary files /dev/null and b/models/__pycache__/teacher.cpython-313.pyc differ diff --git a/models/academic_year.py b/models/academic_year.py new file mode 100644 index 0000000..d0729c8 --- /dev/null +++ b/models/academic_year.py @@ -0,0 +1,9 @@ +from odoo import models, fields + +class AcademicYear(models.Model): + _name = 'school.academic.year' + _description = 'Academic Year' + + name = fields.Char(required=True) + start_date = fields.Date() + end_date = fields.Date() diff --git a/models/assessment.py b/models/assessment.py new file mode 100644 index 0000000..4447f29 --- /dev/null +++ b/models/assessment.py @@ -0,0 +1,17 @@ +from odoo import models, fields + +class SchoolAssessment(models.Model): + _name = 'school.assessment' + _description = 'Assessment' + + enrollment_id = fields.Many2one( + 'school.enrollment', + string="Enrollment" + ) + + subject_id = fields.Many2one( + 'school.subject', + string="Subject" + ) + + grade = fields.Float(string="Grade") diff --git a/models/enrollment.py b/models/enrollment.py new file mode 100644 index 0000000..d961bd8 --- /dev/null +++ b/models/enrollment.py @@ -0,0 +1,26 @@ +from odoo import models, fields + +class SchoolEnrollment(models.Model): + _name = 'school.enrollment' + _description = 'Enrollment' + + student_id = fields.Many2one( + 'cefope.student', + string="Student" + ) + + class_id = fields.Many2one( + 'school.class', + string="Class" + ) + + academic_year_id = fields.Many2one( + 'school.academic.year', + string="Academic Year" + ) + + status = fields.Selection([ + ('active','Active'), + ('completed','Completed'), + ('cancelled','Cancelled') + ], default='active') diff --git a/models/school_class.py b/models/school_class.py new file mode 100644 index 0000000..cbc1b7f --- /dev/null +++ b/models/school_class.py @@ -0,0 +1,17 @@ +from odoo import models, fields + +class SchoolClass(models.Model): + _name = 'school.class' + _description = 'Class' + + name = fields.Char(required=True) + + academic_year_id = fields.Many2one( + 'school.academic.year', + string="Academic Year" + ) + + teacher_id = fields.Many2one( + 'school.teacher', + string="Teacher" + ) diff --git a/models/student.py b/models/student.py new file mode 100644 index 0000000..131679c --- /dev/null +++ b/models/student.py @@ -0,0 +1,14 @@ +from odoo import models, fields + +class Student(models.Model): + _name = 'cefope.student' + _description = 'Student' + + name = fields.Char(string="Name") + email = fields.Char(string="Email") + phone = fields.Char(string="Phone") + + user_id = fields.Many2one( + 'res.users', + string="User" + ) diff --git a/models/subject.py b/models/subject.py new file mode 100644 index 0000000..7409f35 --- /dev/null +++ b/models/subject.py @@ -0,0 +1,12 @@ +from odoo import models, fields + +class SchoolSubject(models.Model): + _name = 'school.subject' + _description = 'Subject' + + name = fields.Char(required=True) + + class_id = fields.Many2one( + 'school.class', + string="Class" + ) diff --git a/models/teacher.py b/models/teacher.py new file mode 100644 index 0000000..95da0bd --- /dev/null +++ b/models/teacher.py @@ -0,0 +1,9 @@ +from odoo import models, fields + +class SchoolTeacher(models.Model): + _name = 'school.teacher' + _description = 'Teacher' + + name = fields.Char(required=True) + email = fields.Char() + phone = fields.Char() diff --git a/security/groups.xml b/security/groups.xml new file mode 100644 index 0000000..f9a11c0 --- /dev/null +++ b/security/groups.xml @@ -0,0 +1,15 @@ + + + + Student + + + + Teacher + + + + School Manager + + + diff --git a/security/ir.model.access.csv b/security/ir.model.access.csv new file mode 100644 index 0000000..b433f95 --- /dev/null +++ b/security/ir.model.access.csv @@ -0,0 +1,8 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_student,access_student,model_cefope_student,,1,1,1,1 +access_teacher,access_teacher,model_school_teacher,,1,1,1,1 +access_academic_year,access_academic_year,model_school_academic_year,,1,1,1,1 +access_class,access_class,model_school_class,,1,1,1,1 +access_subject,access_subject,model_school_subject,,1,1,1,1 +access_enrollment,access_enrollment,model_school_enrollment,,1,1,1,1 +access_assessment,access_assessment,model_school_assessment,,1,1,1,1 diff --git a/security/rules.xml b/security/rules.xml new file mode 100644 index 0000000..07456ec --- /dev/null +++ b/security/rules.xml @@ -0,0 +1,10 @@ + + + + Student sees only his record + + + [('user_id','=',user.id)] + + + diff --git a/views/academic_views.xml b/views/academic_views.xml new file mode 100644 index 0000000..e69de29 diff --git a/views/assessment_views.xml b/views/assessment_views.xml new file mode 100644 index 0000000..e69de29 diff --git a/views/class_views.xml b/views/class_views.xml new file mode 100644 index 0000000..e69de29 diff --git a/views/enrollment_views.xml b/views/enrollment_views.xml new file mode 100644 index 0000000..e69de29 diff --git a/views/school_views.xml b/views/school_views.xml new file mode 100644 index 0000000..1fce6aa --- /dev/null +++ b/views/school_views.xml @@ -0,0 +1,313 @@ + + + + + + + + + + + + + + student.list + cefope.student + + + + + + + + + + + + student.form + cefope.student + +
+ + + + + + + + +
+
+
+ + + Students + cefope.student + list,form + + + + + + + + + + teacher.list + school.teacher + + + + + + + + + + + teacher.form + school.teacher + +
+ + + + + + + +
+
+
+ + + Teachers + school.teacher + list,form + + + + + + + + + + academic.year.list + school.academic.year + + + + + + + + + + + academic.year.form + school.academic.year + +
+ + + + + + + +
+
+
+ + + Academic Years + school.academic.year + list,form + + + + + + + + + + class.list + school.class + + + + + + + + + + + class.form + school.class + +
+ + + + + + + +
+
+
+ + + Classes + school.class + list,form + + + + + + + + + + subject.list + school.subject + + + + + + + + + + subject.form + school.subject + +
+ + + + + + +
+
+
+ + + Subjects + school.subject + list,form + + + + + + + + + + enrollment.list + school.enrollment + + + + + + + + + + + + enrollment.form + school.enrollment + +
+ + + + + + + + +
+
+
+ + + Enrollments + school.enrollment + list,form + + + + + + + + + + assessment.list + school.assessment + + + + + + + + + + + assessment.form + school.assessment + +
+ + + + + + + +
+
+
+ + + Assessments + school.assessment + list,form + + + + +
diff --git a/views/student_views.xml b/views/student_views.xml new file mode 100644 index 0000000..e69de29 diff --git a/views/subject_views.xml b/views/subject_views.xml new file mode 100644 index 0000000..e69de29 diff --git a/views/teacher_views.xml b/views/teacher_views.xml new file mode 100644 index 0000000..e69de29