diff --git a/addons/education_attendance/__pycache__/__init__.cpython-312.pyc b/addons/education_attendance/__pycache__/__init__.cpython-312.pyc index 2c19ce7..9c7e84d 100644 Binary files a/addons/education_attendance/__pycache__/__init__.cpython-312.pyc and b/addons/education_attendance/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_attendance/models/__pycache__/__init__.cpython-312.pyc b/addons/education_attendance/models/__pycache__/__init__.cpython-312.pyc index 6d54e33..4a2b776 100644 Binary files a/addons/education_attendance/models/__pycache__/__init__.cpython-312.pyc and b/addons/education_attendance/models/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_attendance/models/__pycache__/attendance.cpython-312.pyc b/addons/education_attendance/models/__pycache__/attendance.cpython-312.pyc index ad13f28..8adbf77 100644 Binary files a/addons/education_attendance/models/__pycache__/attendance.cpython-312.pyc and b/addons/education_attendance/models/__pycache__/attendance.cpython-312.pyc differ diff --git a/addons/education_attendance/models/__pycache__/attendance_line.cpython-312.pyc b/addons/education_attendance/models/__pycache__/attendance_line.cpython-312.pyc index 5278dd6..486c504 100644 Binary files a/addons/education_attendance/models/__pycache__/attendance_line.cpython-312.pyc and b/addons/education_attendance/models/__pycache__/attendance_line.cpython-312.pyc differ diff --git a/addons/education_attendance/models/__pycache__/attendance_session.cpython-312.pyc b/addons/education_attendance/models/__pycache__/attendance_session.cpython-312.pyc index 3d57427..a58ad04 100644 Binary files a/addons/education_attendance/models/__pycache__/attendance_session.cpython-312.pyc and b/addons/education_attendance/models/__pycache__/attendance_session.cpython-312.pyc differ diff --git a/addons/education_attendance/models/__pycache__/student_inherit.cpython-312.pyc b/addons/education_attendance/models/__pycache__/student_inherit.cpython-312.pyc index ba92e3d..d3a7fdf 100644 Binary files a/addons/education_attendance/models/__pycache__/student_inherit.cpython-312.pyc and b/addons/education_attendance/models/__pycache__/student_inherit.cpython-312.pyc differ diff --git a/addons/education_base/__pycache__/__init__.cpython-312.pyc b/addons/education_base/__pycache__/__init__.cpython-312.pyc index 787f33f..f1692ed 100644 Binary files a/addons/education_base/__pycache__/__init__.cpython-312.pyc and b/addons/education_base/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_base/models/__pycache__/__init__.cpython-312.pyc b/addons/education_base/models/__pycache__/__init__.cpython-312.pyc index a24f486..40a92a5 100644 Binary files a/addons/education_base/models/__pycache__/__init__.cpython-312.pyc and b/addons/education_base/models/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_base/models/__pycache__/academic_level.cpython-312.pyc b/addons/education_base/models/__pycache__/academic_level.cpython-312.pyc index 8ceab35..89d5b9a 100644 Binary files a/addons/education_base/models/__pycache__/academic_level.cpython-312.pyc and b/addons/education_base/models/__pycache__/academic_level.cpython-312.pyc differ diff --git a/addons/education_base/models/__pycache__/academic_term.cpython-312.pyc b/addons/education_base/models/__pycache__/academic_term.cpython-312.pyc index 5397b7a..b96b948 100644 Binary files a/addons/education_base/models/__pycache__/academic_term.cpython-312.pyc and b/addons/education_base/models/__pycache__/academic_term.cpython-312.pyc differ diff --git a/addons/education_base/models/__pycache__/academic_year.cpython-312.pyc b/addons/education_base/models/__pycache__/academic_year.cpython-312.pyc index 46840fd..18f6c57 100644 Binary files a/addons/education_base/models/__pycache__/academic_year.cpython-312.pyc and b/addons/education_base/models/__pycache__/academic_year.cpython-312.pyc differ diff --git a/addons/education_base/models/__pycache__/campus.cpython-312.pyc b/addons/education_base/models/__pycache__/campus.cpython-312.pyc index aa2817f..5664ba7 100644 Binary files a/addons/education_base/models/__pycache__/campus.cpython-312.pyc and b/addons/education_base/models/__pycache__/campus.cpython-312.pyc differ diff --git a/addons/education_base/models/__pycache__/department.cpython-312.pyc b/addons/education_base/models/__pycache__/department.cpython-312.pyc index 4d05bcf..c1aa6d8 100644 Binary files a/addons/education_base/models/__pycache__/department.cpython-312.pyc and b/addons/education_base/models/__pycache__/department.cpython-312.pyc differ diff --git a/addons/education_base/models/__pycache__/education_config.cpython-312.pyc b/addons/education_base/models/__pycache__/education_config.cpython-312.pyc index c1cdac4..3195d94 100644 Binary files a/addons/education_base/models/__pycache__/education_config.cpython-312.pyc and b/addons/education_base/models/__pycache__/education_config.cpython-312.pyc differ diff --git a/addons/education_base/models/__pycache__/program.cpython-312.pyc b/addons/education_base/models/__pycache__/program.cpython-312.pyc index 093ed9d..251fc9b 100644 Binary files a/addons/education_base/models/__pycache__/program.cpython-312.pyc and b/addons/education_base/models/__pycache__/program.cpython-312.pyc differ diff --git a/addons/education_dashboard/__pycache__/__init__.cpython-312.pyc b/addons/education_dashboard/__pycache__/__init__.cpython-312.pyc index 8befeb2..3c54756 100644 Binary files a/addons/education_dashboard/__pycache__/__init__.cpython-312.pyc and b/addons/education_dashboard/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_dashboard/controllers/__pycache__/__init__.cpython-312.pyc b/addons/education_dashboard/controllers/__pycache__/__init__.cpython-312.pyc index 753f194..5d90c9b 100644 Binary files a/addons/education_dashboard/controllers/__pycache__/__init__.cpython-312.pyc and b/addons/education_dashboard/controllers/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_dashboard/controllers/__pycache__/main.cpython-312.pyc b/addons/education_dashboard/controllers/__pycache__/main.cpython-312.pyc index f493f8b..8eea5c9 100644 Binary files a/addons/education_dashboard/controllers/__pycache__/main.cpython-312.pyc and b/addons/education_dashboard/controllers/__pycache__/main.cpython-312.pyc differ diff --git a/addons/education_dashboard/models/__pycache__/__init__.cpython-312.pyc b/addons/education_dashboard/models/__pycache__/__init__.cpython-312.pyc index 6750675..4e40340 100644 Binary files a/addons/education_dashboard/models/__pycache__/__init__.cpython-312.pyc and b/addons/education_dashboard/models/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_dashboard/models/__pycache__/dashboard.cpython-312.pyc b/addons/education_dashboard/models/__pycache__/dashboard.cpython-312.pyc index 08707af..4b6911a 100644 Binary files a/addons/education_dashboard/models/__pycache__/dashboard.cpython-312.pyc and b/addons/education_dashboard/models/__pycache__/dashboard.cpython-312.pyc differ diff --git a/addons/education_demo_data/__pycache__/__init__.cpython-312.pyc b/addons/education_demo_data/__pycache__/__init__.cpython-312.pyc index c858f34..00e86a8 100644 Binary files a/addons/education_demo_data/__pycache__/__init__.cpython-312.pyc and b/addons/education_demo_data/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_demo_data/controllers/__pycache__/__init__.cpython-312.pyc b/addons/education_demo_data/controllers/__pycache__/__init__.cpython-312.pyc index bf0cb7c..25d86ef 100644 Binary files a/addons/education_demo_data/controllers/__pycache__/__init__.cpython-312.pyc and b/addons/education_demo_data/controllers/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_demo_data/controllers/__pycache__/demo_login.cpython-312.pyc b/addons/education_demo_data/controllers/__pycache__/demo_login.cpython-312.pyc index 81b25e1..4b5cf7a 100644 Binary files a/addons/education_demo_data/controllers/__pycache__/demo_login.cpython-312.pyc and b/addons/education_demo_data/controllers/__pycache__/demo_login.cpython-312.pyc differ diff --git a/addons/education_demo_data/demo_data_generator.py b/addons/education_demo_data/demo_data_generator.py index 4363a9b..a443e1c 100644 --- a/addons/education_demo_data/demo_data_generator.py +++ b/addons/education_demo_data/demo_data_generator.py @@ -137,7 +137,8 @@ def generate_demo_data(env): 'program_id': program.id, 'campus_id': campus.id, 'academic_year_id': year.id, - 'status': 'active' + 'status': 'active', + 'portal_user_id': student_user.id }) # Map student ID to portal user if required by ERP architecture diff --git a/addons/education_exam/__pycache__/__init__.cpython-312.pyc b/addons/education_exam/__pycache__/__init__.cpython-312.pyc index 46d488b..a121821 100644 Binary files a/addons/education_exam/__pycache__/__init__.cpython-312.pyc and b/addons/education_exam/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_exam/controllers/__pycache__/__init__.cpython-312.pyc b/addons/education_exam/controllers/__pycache__/__init__.cpython-312.pyc index 0841217..b31b027 100644 Binary files a/addons/education_exam/controllers/__pycache__/__init__.cpython-312.pyc and b/addons/education_exam/controllers/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_exam/controllers/__pycache__/portal_exam.cpython-312.pyc b/addons/education_exam/controllers/__pycache__/portal_exam.cpython-312.pyc index cb8e758..cc692a4 100644 Binary files a/addons/education_exam/controllers/__pycache__/portal_exam.cpython-312.pyc and b/addons/education_exam/controllers/__pycache__/portal_exam.cpython-312.pyc differ diff --git a/addons/education_exam/models/__pycache__/__init__.cpython-312.pyc b/addons/education_exam/models/__pycache__/__init__.cpython-312.pyc index a0607ea..9ead79c 100644 Binary files a/addons/education_exam/models/__pycache__/__init__.cpython-312.pyc and b/addons/education_exam/models/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_exam/models/__pycache__/education_exam.cpython-312.pyc b/addons/education_exam/models/__pycache__/education_exam.cpython-312.pyc index 50b170e..7966f5c 100644 Binary files a/addons/education_exam/models/__pycache__/education_exam.cpython-312.pyc and b/addons/education_exam/models/__pycache__/education_exam.cpython-312.pyc differ diff --git a/addons/education_exam/models/__pycache__/education_exam_result.cpython-312.pyc b/addons/education_exam/models/__pycache__/education_exam_result.cpython-312.pyc index 4a089fe..256fcf8 100644 Binary files a/addons/education_exam/models/__pycache__/education_exam_result.cpython-312.pyc and b/addons/education_exam/models/__pycache__/education_exam_result.cpython-312.pyc differ diff --git a/addons/education_exam/models/__pycache__/education_exam_type.cpython-312.pyc b/addons/education_exam/models/__pycache__/education_exam_type.cpython-312.pyc index 762c176..c006b36 100644 Binary files a/addons/education_exam/models/__pycache__/education_exam_type.cpython-312.pyc and b/addons/education_exam/models/__pycache__/education_exam_type.cpython-312.pyc differ diff --git a/addons/education_exam/models/__pycache__/education_grading.cpython-312.pyc b/addons/education_exam/models/__pycache__/education_grading.cpython-312.pyc index 6611d29..c9561d4 100644 Binary files a/addons/education_exam/models/__pycache__/education_grading.cpython-312.pyc and b/addons/education_exam/models/__pycache__/education_grading.cpython-312.pyc differ diff --git a/addons/education_exam/models/__pycache__/education_student_inherit.cpython-312.pyc b/addons/education_exam/models/__pycache__/education_student_inherit.cpython-312.pyc index f9a45ea..6db2a93 100644 Binary files a/addons/education_exam/models/__pycache__/education_student_inherit.cpython-312.pyc and b/addons/education_exam/models/__pycache__/education_student_inherit.cpython-312.pyc differ diff --git a/addons/education_exam/models/__pycache__/education_subject.cpython-312.pyc b/addons/education_exam/models/__pycache__/education_subject.cpython-312.pyc index 36deab8..c5ef5b6 100644 Binary files a/addons/education_exam/models/__pycache__/education_subject.cpython-312.pyc and b/addons/education_exam/models/__pycache__/education_subject.cpython-312.pyc differ diff --git a/addons/education_finance/__pycache__/__init__.cpython-312.pyc b/addons/education_finance/__pycache__/__init__.cpython-312.pyc index ee307dc..c691670 100644 Binary files a/addons/education_finance/__pycache__/__init__.cpython-312.pyc and b/addons/education_finance/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_finance/models/__pycache__/__init__.cpython-312.pyc b/addons/education_finance/models/__pycache__/__init__.cpython-312.pyc index 386df61..753dace 100644 Binary files a/addons/education_finance/models/__pycache__/__init__.cpython-312.pyc and b/addons/education_finance/models/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_finance/models/__pycache__/fee_assignment.cpython-312.pyc b/addons/education_finance/models/__pycache__/fee_assignment.cpython-312.pyc index 7450b54..5117fbb 100644 Binary files a/addons/education_finance/models/__pycache__/fee_assignment.cpython-312.pyc and b/addons/education_finance/models/__pycache__/fee_assignment.cpython-312.pyc differ diff --git a/addons/education_finance/models/__pycache__/fee_category.cpython-312.pyc b/addons/education_finance/models/__pycache__/fee_category.cpython-312.pyc index 576fcc8..57498b6 100644 Binary files a/addons/education_finance/models/__pycache__/fee_category.cpython-312.pyc and b/addons/education_finance/models/__pycache__/fee_category.cpython-312.pyc differ diff --git a/addons/education_finance/models/__pycache__/fee_structure.cpython-312.pyc b/addons/education_finance/models/__pycache__/fee_structure.cpython-312.pyc index a033712..cc81745 100644 Binary files a/addons/education_finance/models/__pycache__/fee_structure.cpython-312.pyc and b/addons/education_finance/models/__pycache__/fee_structure.cpython-312.pyc differ diff --git a/addons/education_finance/models/__pycache__/fee_type.cpython-312.pyc b/addons/education_finance/models/__pycache__/fee_type.cpython-312.pyc index db904a2..dfbc7b6 100644 Binary files a/addons/education_finance/models/__pycache__/fee_type.cpython-312.pyc and b/addons/education_finance/models/__pycache__/fee_type.cpython-312.pyc differ diff --git a/addons/education_finance/models/__pycache__/student_discount.cpython-312.pyc b/addons/education_finance/models/__pycache__/student_discount.cpython-312.pyc index 13c53d2..9d57a8e 100644 Binary files a/addons/education_finance/models/__pycache__/student_discount.cpython-312.pyc and b/addons/education_finance/models/__pycache__/student_discount.cpython-312.pyc differ diff --git a/addons/education_finance/models/__pycache__/student_inherit.cpython-312.pyc b/addons/education_finance/models/__pycache__/student_inherit.cpython-312.pyc index 05ed766..8502dd6 100644 Binary files a/addons/education_finance/models/__pycache__/student_inherit.cpython-312.pyc and b/addons/education_finance/models/__pycache__/student_inherit.cpython-312.pyc differ diff --git a/addons/education_finance/models/__pycache__/student_ledger.cpython-312.pyc b/addons/education_finance/models/__pycache__/student_ledger.cpython-312.pyc index 8dd416f..89e93a1 100644 Binary files a/addons/education_finance/models/__pycache__/student_ledger.cpython-312.pyc and b/addons/education_finance/models/__pycache__/student_ledger.cpython-312.pyc differ diff --git a/addons/education_finance/models/__pycache__/student_payment.cpython-312.pyc b/addons/education_finance/models/__pycache__/student_payment.cpython-312.pyc index 0f28918..9bcad71 100644 Binary files a/addons/education_finance/models/__pycache__/student_payment.cpython-312.pyc and b/addons/education_finance/models/__pycache__/student_payment.cpython-312.pyc differ diff --git a/addons/education_finance/models/__pycache__/student_refund.cpython-312.pyc b/addons/education_finance/models/__pycache__/student_refund.cpython-312.pyc index 9fd6a37..82601bd 100644 Binary files a/addons/education_finance/models/__pycache__/student_refund.cpython-312.pyc and b/addons/education_finance/models/__pycache__/student_refund.cpython-312.pyc differ diff --git a/addons/education_finance/models/__pycache__/student_scholarship.cpython-312.pyc b/addons/education_finance/models/__pycache__/student_scholarship.cpython-312.pyc index 78f4f11..a209e9b 100644 Binary files a/addons/education_finance/models/__pycache__/student_scholarship.cpython-312.pyc and b/addons/education_finance/models/__pycache__/student_scholarship.cpython-312.pyc differ diff --git a/addons/education_hostel/__pycache__/__init__.cpython-312.pyc b/addons/education_hostel/__pycache__/__init__.cpython-312.pyc index fd0eccd..f0409b8 100644 Binary files a/addons/education_hostel/__pycache__/__init__.cpython-312.pyc and b/addons/education_hostel/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_hostel/controllers/__pycache__/__init__.cpython-312.pyc b/addons/education_hostel/controllers/__pycache__/__init__.cpython-312.pyc index 948b789..43a2470 100644 Binary files a/addons/education_hostel/controllers/__pycache__/__init__.cpython-312.pyc and b/addons/education_hostel/controllers/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_hostel/controllers/__pycache__/portal.cpython-312.pyc b/addons/education_hostel/controllers/__pycache__/portal.cpython-312.pyc index dd81634..c9b271e 100644 Binary files a/addons/education_hostel/controllers/__pycache__/portal.cpython-312.pyc and b/addons/education_hostel/controllers/__pycache__/portal.cpython-312.pyc differ diff --git a/addons/education_hostel/models/__pycache__/__init__.cpython-312.pyc b/addons/education_hostel/models/__pycache__/__init__.cpython-312.pyc index 467def1..a462b4f 100644 Binary files a/addons/education_hostel/models/__pycache__/__init__.cpython-312.pyc and b/addons/education_hostel/models/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_hostel/models/__pycache__/hostel.cpython-312.pyc b/addons/education_hostel/models/__pycache__/hostel.cpython-312.pyc index c49a0b1..a23e14a 100644 Binary files a/addons/education_hostel/models/__pycache__/hostel.cpython-312.pyc and b/addons/education_hostel/models/__pycache__/hostel.cpython-312.pyc differ diff --git a/addons/education_hostel/models/__pycache__/hostel_bed.cpython-312.pyc b/addons/education_hostel/models/__pycache__/hostel_bed.cpython-312.pyc index 6a768be..898a367 100644 Binary files a/addons/education_hostel/models/__pycache__/hostel_bed.cpython-312.pyc and b/addons/education_hostel/models/__pycache__/hostel_bed.cpython-312.pyc differ diff --git a/addons/education_hostel/models/__pycache__/hostel_complaint.cpython-312.pyc b/addons/education_hostel/models/__pycache__/hostel_complaint.cpython-312.pyc index ff659af..f4ec46f 100644 Binary files a/addons/education_hostel/models/__pycache__/hostel_complaint.cpython-312.pyc and b/addons/education_hostel/models/__pycache__/hostel_complaint.cpython-312.pyc differ diff --git a/addons/education_hostel/models/__pycache__/hostel_fee.cpython-312.pyc b/addons/education_hostel/models/__pycache__/hostel_fee.cpython-312.pyc index ef14388..a1a9364 100644 Binary files a/addons/education_hostel/models/__pycache__/hostel_fee.cpython-312.pyc and b/addons/education_hostel/models/__pycache__/hostel_fee.cpython-312.pyc differ diff --git a/addons/education_hostel/models/__pycache__/hostel_floor.cpython-312.pyc b/addons/education_hostel/models/__pycache__/hostel_floor.cpython-312.pyc index 25daf3a..558c653 100644 Binary files a/addons/education_hostel/models/__pycache__/hostel_floor.cpython-312.pyc and b/addons/education_hostel/models/__pycache__/hostel_floor.cpython-312.pyc differ diff --git a/addons/education_hostel/models/__pycache__/hostel_member.cpython-312.pyc b/addons/education_hostel/models/__pycache__/hostel_member.cpython-312.pyc index 8307786..1ea6558 100644 Binary files a/addons/education_hostel/models/__pycache__/hostel_member.cpython-312.pyc and b/addons/education_hostel/models/__pycache__/hostel_member.cpython-312.pyc differ diff --git a/addons/education_hostel/models/__pycache__/hostel_room.cpython-312.pyc b/addons/education_hostel/models/__pycache__/hostel_room.cpython-312.pyc index 5236b4c..73b73e6 100644 Binary files a/addons/education_hostel/models/__pycache__/hostel_room.cpython-312.pyc and b/addons/education_hostel/models/__pycache__/hostel_room.cpython-312.pyc differ diff --git a/addons/education_hostel/models/__pycache__/hostel_visitor.cpython-312.pyc b/addons/education_hostel/models/__pycache__/hostel_visitor.cpython-312.pyc index f2cf6fd..47b31bc 100644 Binary files a/addons/education_hostel/models/__pycache__/hostel_visitor.cpython-312.pyc and b/addons/education_hostel/models/__pycache__/hostel_visitor.cpython-312.pyc differ diff --git a/addons/education_library/__pycache__/__init__.cpython-312.pyc b/addons/education_library/__pycache__/__init__.cpython-312.pyc index 93b6d63..31c049d 100644 Binary files a/addons/education_library/__pycache__/__init__.cpython-312.pyc and b/addons/education_library/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_library/controllers/__pycache__/__init__.cpython-312.pyc b/addons/education_library/controllers/__pycache__/__init__.cpython-312.pyc index 0715051..9ba5a68 100644 Binary files a/addons/education_library/controllers/__pycache__/__init__.cpython-312.pyc and b/addons/education_library/controllers/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_library/controllers/__pycache__/main.cpython-312.pyc b/addons/education_library/controllers/__pycache__/main.cpython-312.pyc index 28138f1..5c59771 100644 Binary files a/addons/education_library/controllers/__pycache__/main.cpython-312.pyc and b/addons/education_library/controllers/__pycache__/main.cpython-312.pyc differ diff --git a/addons/education_library/models/__pycache__/__init__.cpython-312.pyc b/addons/education_library/models/__pycache__/__init__.cpython-312.pyc index ccb8470..2fdf77a 100644 Binary files a/addons/education_library/models/__pycache__/__init__.cpython-312.pyc and b/addons/education_library/models/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_library/models/__pycache__/education_library.cpython-312.pyc b/addons/education_library/models/__pycache__/education_library.cpython-312.pyc index 40b99b1..4b99d2e 100644 Binary files a/addons/education_library/models/__pycache__/education_library.cpython-312.pyc and b/addons/education_library/models/__pycache__/education_library.cpython-312.pyc differ diff --git a/addons/education_library/models/__pycache__/education_library_book.cpython-312.pyc b/addons/education_library/models/__pycache__/education_library_book.cpython-312.pyc index 9954297..5cfd56d 100644 Binary files a/addons/education_library/models/__pycache__/education_library_book.cpython-312.pyc and b/addons/education_library/models/__pycache__/education_library_book.cpython-312.pyc differ diff --git a/addons/education_library/models/__pycache__/education_library_book_copy.cpython-312.pyc b/addons/education_library/models/__pycache__/education_library_book_copy.cpython-312.pyc index e1ece55..3af4f50 100644 Binary files a/addons/education_library/models/__pycache__/education_library_book_copy.cpython-312.pyc and b/addons/education_library/models/__pycache__/education_library_book_copy.cpython-312.pyc differ diff --git a/addons/education_library/models/__pycache__/education_library_category.cpython-312.pyc b/addons/education_library/models/__pycache__/education_library_category.cpython-312.pyc index 791ddfa..6bcdef5 100644 Binary files a/addons/education_library/models/__pycache__/education_library_category.cpython-312.pyc and b/addons/education_library/models/__pycache__/education_library_category.cpython-312.pyc differ diff --git a/addons/education_library/models/__pycache__/education_library_fine.cpython-312.pyc b/addons/education_library/models/__pycache__/education_library_fine.cpython-312.pyc index 3e1b8ff..27ccd5b 100644 Binary files a/addons/education_library/models/__pycache__/education_library_fine.cpython-312.pyc and b/addons/education_library/models/__pycache__/education_library_fine.cpython-312.pyc differ diff --git a/addons/education_library/models/__pycache__/education_library_issue.cpython-312.pyc b/addons/education_library/models/__pycache__/education_library_issue.cpython-312.pyc index 5d40826..a9ea253 100644 Binary files a/addons/education_library/models/__pycache__/education_library_issue.cpython-312.pyc and b/addons/education_library/models/__pycache__/education_library_issue.cpython-312.pyc differ diff --git a/addons/education_library/models/__pycache__/education_library_member.cpython-312.pyc b/addons/education_library/models/__pycache__/education_library_member.cpython-312.pyc index a7c5c58..44721c2 100644 Binary files a/addons/education_library/models/__pycache__/education_library_member.cpython-312.pyc and b/addons/education_library/models/__pycache__/education_library_member.cpython-312.pyc differ diff --git a/addons/education_library/models/__pycache__/education_library_reservation.cpython-312.pyc b/addons/education_library/models/__pycache__/education_library_reservation.cpython-312.pyc index bb2024b..63d5a88 100644 Binary files a/addons/education_library/models/__pycache__/education_library_reservation.cpython-312.pyc and b/addons/education_library/models/__pycache__/education_library_reservation.cpython-312.pyc differ diff --git a/addons/education_library/models/__pycache__/res_config_settings.cpython-312.pyc b/addons/education_library/models/__pycache__/res_config_settings.cpython-312.pyc index f1a427d..2604486 100644 Binary files a/addons/education_library/models/__pycache__/res_config_settings.cpython-312.pyc and b/addons/education_library/models/__pycache__/res_config_settings.cpython-312.pyc differ diff --git a/addons/education_lms/__pycache__/__init__.cpython-312.pyc b/addons/education_lms/__pycache__/__init__.cpython-312.pyc index 2fc2cd3..14e1c68 100644 Binary files a/addons/education_lms/__pycache__/__init__.cpython-312.pyc and b/addons/education_lms/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_lms/controllers/__pycache__/__init__.cpython-312.pyc b/addons/education_lms/controllers/__pycache__/__init__.cpython-312.pyc index 3c6e084..c319100 100644 Binary files a/addons/education_lms/controllers/__pycache__/__init__.cpython-312.pyc and b/addons/education_lms/controllers/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_lms/controllers/__pycache__/main.cpython-312.pyc b/addons/education_lms/controllers/__pycache__/main.cpython-312.pyc index 35a9ca2..a012dd9 100644 Binary files a/addons/education_lms/controllers/__pycache__/main.cpython-312.pyc and b/addons/education_lms/controllers/__pycache__/main.cpython-312.pyc differ diff --git a/addons/education_lms/models/__pycache__/__init__.cpython-312.pyc b/addons/education_lms/models/__pycache__/__init__.cpython-312.pyc index ceb59c7..b8a0554 100644 Binary files a/addons/education_lms/models/__pycache__/__init__.cpython-312.pyc and b/addons/education_lms/models/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_lms/models/__pycache__/education_lms_assignment.cpython-312.pyc b/addons/education_lms/models/__pycache__/education_lms_assignment.cpython-312.pyc index 9088b0a..679171c 100644 Binary files a/addons/education_lms/models/__pycache__/education_lms_assignment.cpython-312.pyc and b/addons/education_lms/models/__pycache__/education_lms_assignment.cpython-312.pyc differ diff --git a/addons/education_lms/models/__pycache__/education_lms_content.cpython-312.pyc b/addons/education_lms/models/__pycache__/education_lms_content.cpython-312.pyc index 97f2297..ba70222 100644 Binary files a/addons/education_lms/models/__pycache__/education_lms_content.cpython-312.pyc and b/addons/education_lms/models/__pycache__/education_lms_content.cpython-312.pyc differ diff --git a/addons/education_lms/models/__pycache__/education_lms_course.cpython-312.pyc b/addons/education_lms/models/__pycache__/education_lms_course.cpython-312.pyc index 504824b..ea60a73 100644 Binary files a/addons/education_lms/models/__pycache__/education_lms_course.cpython-312.pyc and b/addons/education_lms/models/__pycache__/education_lms_course.cpython-312.pyc differ diff --git a/addons/education_lms/models/__pycache__/education_lms_submission.cpython-312.pyc b/addons/education_lms/models/__pycache__/education_lms_submission.cpython-312.pyc index 500977b..ee130cb 100644 Binary files a/addons/education_lms/models/__pycache__/education_lms_submission.cpython-312.pyc and b/addons/education_lms/models/__pycache__/education_lms_submission.cpython-312.pyc differ diff --git a/addons/education_mobile_api/__init__.py b/addons/education_mobile_api/__init__.py new file mode 100644 index 0000000..3b38916 --- /dev/null +++ b/addons/education_mobile_api/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +from . import models +from . import controllers diff --git a/addons/education_mobile_api/__manifest__.py b/addons/education_mobile_api/__manifest__.py new file mode 100644 index 0000000..a2bae7c --- /dev/null +++ b/addons/education_mobile_api/__manifest__.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +{ + 'name': 'Education Mobile API', + 'version': '1.0', + 'summary': 'REST API for Mobile Application', + 'description': """ + Dedicated REST API layer in Odoo specifically for the mobile application. + """, + 'category': 'Education', + 'author': 'Antigravity', + 'depends': ['base', 'web', 'education_portal'], + 'data': [ + 'security/ir.model.access.csv', + ], + 'installable': True, + 'application': False, + 'auto_install': False, +} diff --git a/addons/education_mobile_api/__pycache__/__init__.cpython-312.pyc b/addons/education_mobile_api/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..887d138 Binary files /dev/null and b/addons/education_mobile_api/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_mobile_api/controllers/__init__.py b/addons/education_mobile_api/controllers/__init__.py new file mode 100644 index 0000000..f97a6a9 --- /dev/null +++ b/addons/education_mobile_api/controllers/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +from . import auth +from . import student diff --git a/addons/education_mobile_api/controllers/__pycache__/__init__.cpython-312.pyc b/addons/education_mobile_api/controllers/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..7638ba4 Binary files /dev/null and b/addons/education_mobile_api/controllers/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_mobile_api/controllers/__pycache__/auth.cpython-312.pyc b/addons/education_mobile_api/controllers/__pycache__/auth.cpython-312.pyc new file mode 100644 index 0000000..3b4fee1 Binary files /dev/null and b/addons/education_mobile_api/controllers/__pycache__/auth.cpython-312.pyc differ diff --git a/addons/education_mobile_api/controllers/__pycache__/student.cpython-312.pyc b/addons/education_mobile_api/controllers/__pycache__/student.cpython-312.pyc new file mode 100644 index 0000000..a3c0075 Binary files /dev/null and b/addons/education_mobile_api/controllers/__pycache__/student.cpython-312.pyc differ diff --git a/addons/education_mobile_api/controllers/auth.py b/addons/education_mobile_api/controllers/auth.py new file mode 100644 index 0000000..5efa522 --- /dev/null +++ b/addons/education_mobile_api/controllers/auth.py @@ -0,0 +1,106 @@ +# -*- coding: utf-8 -*- +import json +import logging +from odoo import http +from odoo.http import request +from odoo.exceptions import AccessError, AccessDenied + +_logger = logging.getLogger(__name__) + +def json_response(success, data=None, error_code=None, error_message=None, status=200): + if success: + body = { + "success": True, + "data": data or {} + } + else: + body = { + "success": False, + "error": { + "code": error_code or "ERROR", + "message": error_message or "An error occurred" + } + } + + return request.make_response( + json.dumps(body), + headers=[('Content-Type', 'application/json')], + status=status + ) + +class MobileAuth(http.Controller): + + @http.route('/api/mobile/v1/auth/login', type='http', auth='none', methods=['POST'], csrf=False, cors='*') + def login(self, **kwargs): + try: + data = json.loads(request.httprequest.data) + email = data.get('email') + password = data.get('password') + + if not email or not password: + return json_response(False, error_code="INVALID_REQUEST", error_message="Email and password are required", status=400) + + db = request.db or request.env.registry.db_name + + # Authenticate creates a session securely + credential = {'login': email, 'password': password, 'type': 'password'} + auth_info = request.session.authenticate(request.env, credential) + uid = auth_info.get('uid') + if not uid: + return json_response(False, error_code="AUTH_FAILED", error_message="Invalid email or password", status=401) + + request.update_env(user=uid) + user = request.env['res.users'].sudo().browse(uid) + student = user.student_id + + return json_response(True, data={ + "user": { + "id": user.id, + "name": user.name, + "email": user.login, + "role": "student" if student else "user" + }, + "student": { + "id": student.id, + "name": student.full_name + } if student else None + }) + + except (AccessError, AccessDenied): + return json_response(False, error_code="AUTH_FAILED", error_message="Invalid email or password", status=401) + except Exception as e: + _logger.exception("Login error") + return json_response(False, error_code="SERVER_ERROR", error_message=str(e), status=500) + + @http.route('/api/mobile/v1/auth/logout', type='http', auth='public', methods=['POST'], csrf=False, cors='*') + def logout(self, **kwargs): + if request.env.user._is_public(): + return json_response(False, error_code="AUTH_REQUIRED", error_message="Authentication required", status=401) + try: + request.session.logout(keep_db=True) + return json_response(True, data={"message": "Logged out successfully"}) + except Exception as e: + return json_response(False, error_code="SERVER_ERROR", error_message=str(e), status=500) + + @http.route('/api/mobile/v1/auth/me', type='http', auth='public', methods=['GET'], cors='*') + def get_me(self, **kwargs): + if request.env.user._is_public(): + return json_response(False, error_code="AUTH_REQUIRED", error_message="Authentication required", status=401) + try: + user = request.env.user + student = user.student_id + + return json_response(True, data={ + "user": { + "id": user.id, + "name": user.name, + "email": user.login, + "role": "student" if student else "user" + }, + "student": { + "id": student.id, + "name": student.full_name + } if student else None + }) + except Exception as e: + return json_response(False, error_code="SERVER_ERROR", error_message=str(e), status=500) diff --git a/addons/education_mobile_api/controllers/student.py b/addons/education_mobile_api/controllers/student.py new file mode 100644 index 0000000..9e635d9 --- /dev/null +++ b/addons/education_mobile_api/controllers/student.py @@ -0,0 +1,314 @@ +# -*- coding: utf-8 -*- +import json +import logging +from datetime import datetime, date +from odoo import http +from odoo.http import request + +_logger = logging.getLogger(__name__) + +def json_response(success, data=None, error_code=None, error_message=None, status=200): + if success: + body = { + "success": True, + "data": data or {} + } + else: + body = { + "success": False, + "error": { + "code": error_code or "ERROR", + "message": error_message or "An error occurred" + } + } + + return request.make_response( + json.dumps(body, default=str), + headers=[('Content-Type', 'application/json')], + status=status + ) + +def require_student(func): + def wrapper(self, *args, **kwargs): + if request.env.user._is_public(): + return json_response(False, error_code="AUTH_REQUIRED", error_message="Authentication required", status=401) + + student = request.env.user.sudo().student_id + if not student: + return json_response(False, error_code="STUDENT_NOT_LINKED", error_message="No student profile is linked to this account", status=403) + + return func(self, student, *args, **kwargs) + return wrapper + +def format_float_time(float_time): + hours = int(float_time) + minutes = int(round((float_time - hours) * 60)) + if minutes == 60: + minutes = 0 + hours += 1 + hours = hours % 24 + am_pm = 'AM' if hours < 12 else 'PM' + display_hours = hours % 12 + if display_hours == 0: + display_hours = 12 + return f"{display_hours:02d}:{minutes:02d} {am_pm}" + +class MobileStudent(http.Controller): + + def _get_rel(self, record): + if record: + return {"id": record.id, "name": record.name} + return None + + @http.route('/api/mobile/v1/student/profile', type='http', auth='public', methods=['GET'], cors='*') + @require_student + def get_profile(self, student, **kwargs): + try: + data = { + "id": student.id, + "student_id": student.student_id, + "admission_number": student.admission_number, + "roll_number": student.roll_number, + "full_name": student.full_name, + "email": student.email, + "mobile": student.mobile, + "gender": student.gender, + "date_of_birth": student.date_of_birth, + "status": student.status, + "campus": self._get_rel(student.campus_id), + "department": self._get_rel(student.department_id), + "program": self._get_rel(student.program_id), + "level": self._get_rel(student.level_id), + "academic_year": self._get_rel(student.academic_year_id), + "academic_term": self._get_rel(student.academic_term_id), + "batch": self._get_rel(student.batch_id), + "semester": self._get_rel(student.semester_id), + "section": self._get_rel(student.section_id) + } + return json_response(True, data=data) + except Exception as e: + return json_response(False, error_code="SERVER_ERROR", error_message=str(e), status=500) + + def _get_attendance_summary(self, student, from_date=None, to_date=None): + domain = [('student_id', '=', student.id)] + if from_date: + domain.append(('date', '>=', from_date)) + if to_date: + domain.append(('date', '<=', to_date)) + + records = request.env['education.attendance'].search(domain) + + total_sessions = len(records) + present = len([a for a in records if a.status == 'present']) + absent = len([a for a in records if a.status == 'absent']) + late = len([a for a in records if a.status == 'late']) + medical_leave = len([a for a in records if a.status == 'medical_leave']) + on_duty = len([a for a in records if a.status == 'on_duty']) + + effective_present = present + on_duty + (late * 0.5) + percentage = round((effective_present / total_sessions * 100), 1) if total_sessions > 0 else 100.0 + + return { + "percentage": percentage, + "present": present, + "absent": absent, + "late": late, + "medical_leave": medical_leave, + "on_duty": on_duty + } + + def _get_timetable_slots(self, student, date_filter=None): + if not student.program_id or not student.academic_year_id: + return [] + + domain = [ + ('program_id', '=', student.program_id.id), + ('academic_year_id', '=', student.academic_year_id.id), + ('active', '=', True) + ] + + if student.academic_term_id: + domain += ['|', ('term_id', '=', False), ('term_id', '=', student.academic_term_id.id)] + else: + domain += [('term_id', '=', False)] + + if student.batch_id: + domain += ['|', ('batch_id', '=', False), ('batch_id', '=', student.batch_id.id)] + else: + domain += [('batch_id', '=', False)] + + if date_filter: + domain += [('date', '=', date_filter)] + + slots = request.env['education.timetable.slot'].sudo().search(domain, order="date asc, start_time asc") + + return [{ + "id": s.id, + "date": s.date, + "day": s.date.strftime('%A') if s.date else '', + "start_time": format_float_time(s.start_time), + "end_time": format_float_time(s.end_time), + "subject": self._get_rel(s.subject_id), + "faculty": self._get_rel(s.faculty_id), + "room": self._get_rel(s.room_id) + } for s in slots] + + @http.route('/api/mobile/v1/student/dashboard', type='http', auth='public', methods=['GET'], cors='*') + @require_student + def get_dashboard(self, student, **kwargs): + try: + today = date.today() + + # Upcoming Exams + exams = request.env['education.exam'].sudo().search_read([ + ('state', 'in', ['scheduled', 'ongoing']), + ('program_id', '=', student.program_id.id), + ('academic_year_id', '=', student.academic_year_id.id), + ], fields=['id', 'name', 'state', 'start_date'], order='start_date asc', limit=5) + + # Announcements + announcements = request.env['education.announcement'].search_read( + [('active', '=', True)], + fields=['id', 'name', 'date', 'summary'], + order='date desc, id desc', + limit=5 + ) + + # Recent Results + results = request.env['education.exam.result'].search([ + ('student_id', '=', student.id), + ('published', '=', True) + ], order='published_date desc, id desc', limit=5) + + results_data = [] + for r in results: + results_data.append({ + "id": r.id, + "exam": self._get_rel(r.exam_id), + "percentage": r.percentage, + "grade": r.grade_id.name if r.grade_id else None, + "status": r.result_status + }) + + data = { + "student": { + "id": student.id, + "full_name": student.full_name, + "program": self._get_rel(student.program_id) + }, + "attendance": self._get_attendance_summary(student), + "today_timetable": self._get_timetable_slots(student, date_filter=today), + "upcoming_exams": exams, + "recent_results": results_data, + "announcements": announcements + } + return json_response(True, data=data) + except Exception as e: + return json_response(False, error_code="SERVER_ERROR", error_message=str(e), status=500) + + @http.route('/api/mobile/v1/student/attendance', type='http', auth='public', methods=['GET'], cors='*') + @require_student + def get_attendance(self, student, **kwargs): + try: + from_date = kwargs.get('from_date') + to_date = kwargs.get('to_date') + + if from_date: + from_date = datetime.strptime(from_date, '%Y-%m-%d').date() + if to_date: + to_date = datetime.strptime(to_date, '%Y-%m-%d').date() + + summary = self._get_attendance_summary(student, from_date, to_date) + + domain = [('student_id', '=', student.id)] + if from_date: + domain.append(('date', '>=', from_date)) + if to_date: + domain.append(('date', '<=', to_date)) + + records = request.env['education.attendance'].search_read( + domain, + fields=['id', 'date', 'status'], + order='date desc, id desc', + limit=100 + ) + + return json_response(True, data={ + "summary": summary, + "records": records + }) + except ValueError: + return json_response(False, error_code="INVALID_DATE", error_message="Dates must be in YYYY-MM-DD format", status=400) + except Exception as e: + return json_response(False, error_code="SERVER_ERROR", error_message=str(e), status=500) + + @http.route('/api/mobile/v1/student/timetable', type='http', auth='public', methods=['GET'], cors='*') + @require_student + def get_timetable(self, student, **kwargs): + try: + slots = self._get_timetable_slots(student) + return json_response(True, data={"slots": slots}) + except Exception as e: + return json_response(False, error_code="SERVER_ERROR", error_message=str(e), status=500) + + @http.route('/api/mobile/v1/student/exams', type='http', auth='public', methods=['GET'], cors='*') + @require_student + def get_exams(self, student, **kwargs): + try: + exams = request.env['education.exam'].sudo().search([ + ('program_id', '=', student.program_id.id), + ('academic_year_id', '=', student.academic_year_id.id), + ], order='start_date desc') + + exams_data = [{ + "id": exam.id, + "name": exam.name, + "state": exam.state, + "start_date": exam.start_date, + "end_date": exam.end_date, + "program": self._get_rel(exam.program_id), + "academic_year": self._get_rel(exam.academic_year_id) + } for exam in exams] + + return json_response(True, data={"exams": exams_data}) + except Exception as e: + return json_response(False, error_code="SERVER_ERROR", error_message=str(e), status=500) + + @http.route('/api/mobile/v1/student/results', type='http', auth='public', methods=['GET'], cors='*') + @require_student + def get_results(self, student, **kwargs): + try: + results = request.env['education.exam.result'].search([ + ('student_id', '=', student.id), + ('published', '=', True) + ], order='published_date desc, id desc') + + results_data = [] + for r in results: + lines = [] + for line in r.line_ids: + lines.append({ + "subject": self._get_rel(line.subject_id), + "max_marks": line.max_marks, + "pass_marks": line.pass_marks, + "obtained_marks": line.obtained_marks, + "percentage": line.percentage, + "grade": line.grade_id.name if line.grade_id else None, + "status": line.status + }) + + results_data.append({ + "id": r.id, + "exam": self._get_rel(r.exam_id), + "total_max_marks": r.total_max_marks, + "total_obtained_marks": r.total_obtained_marks, + "percentage": r.percentage, + "grade": r.grade_id.name if r.grade_id else None, + "status": r.result_status, + "published_date": r.published_date, + "lines": lines + }) + + return json_response(True, data={"results": results_data}) + except Exception as e: + return json_response(False, error_code="SERVER_ERROR", error_message=str(e), status=500) diff --git a/addons/education_mobile_api/models/__init__.py b/addons/education_mobile_api/models/__init__.py new file mode 100644 index 0000000..3a63efc --- /dev/null +++ b/addons/education_mobile_api/models/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import mobile_device diff --git a/addons/education_mobile_api/models/__pycache__/__init__.cpython-312.pyc b/addons/education_mobile_api/models/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..9f0fd37 Binary files /dev/null and b/addons/education_mobile_api/models/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_mobile_api/models/__pycache__/mobile_device.cpython-312.pyc b/addons/education_mobile_api/models/__pycache__/mobile_device.cpython-312.pyc new file mode 100644 index 0000000..7d85de0 Binary files /dev/null and b/addons/education_mobile_api/models/__pycache__/mobile_device.cpython-312.pyc differ diff --git a/addons/education_mobile_api/models/mobile_device.py b/addons/education_mobile_api/models/mobile_device.py new file mode 100644 index 0000000..f71c791 --- /dev/null +++ b/addons/education_mobile_api/models/mobile_device.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +from odoo import models, fields + +class MobileDevice(models.Model): + _name = 'education.mobile.device' + _description = 'Mobile Device Information' + + user_id = fields.Many2one('res.users', string='User', required=True) + device_token = fields.Char(string='Device Token') + platform = fields.Selection([('ios', 'iOS'), ('android', 'Android')], string='Platform') + last_login = fields.Datetime(string='Last Login') diff --git a/addons/education_mobile_api/security/ir.model.access.csv b/addons/education_mobile_api/security/ir.model.access.csv new file mode 100644 index 0000000..21a0217 --- /dev/null +++ b/addons/education_mobile_api/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_education_mobile_device,education.mobile.device,model_education_mobile_device,base.group_user,1,1,1,1 diff --git a/addons/education_portal/__pycache__/__init__.cpython-312.pyc b/addons/education_portal/__pycache__/__init__.cpython-312.pyc index ae25c90..21d9ab6 100644 Binary files a/addons/education_portal/__pycache__/__init__.cpython-312.pyc and b/addons/education_portal/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_portal/controllers/__pycache__/__init__.cpython-312.pyc b/addons/education_portal/controllers/__pycache__/__init__.cpython-312.pyc index 4252d5d..200494e 100644 Binary files a/addons/education_portal/controllers/__pycache__/__init__.cpython-312.pyc and b/addons/education_portal/controllers/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_portal/controllers/__pycache__/main.cpython-312.pyc b/addons/education_portal/controllers/__pycache__/main.cpython-312.pyc index e0c7051..35eef4f 100644 Binary files a/addons/education_portal/controllers/__pycache__/main.cpython-312.pyc and b/addons/education_portal/controllers/__pycache__/main.cpython-312.pyc differ diff --git a/addons/education_portal/controllers/__pycache__/payment.cpython-312.pyc b/addons/education_portal/controllers/__pycache__/payment.cpython-312.pyc index 0c31549..680336f 100644 Binary files a/addons/education_portal/controllers/__pycache__/payment.cpython-312.pyc and b/addons/education_portal/controllers/__pycache__/payment.cpython-312.pyc differ diff --git a/addons/education_portal/models/__pycache__/__init__.cpython-312.pyc b/addons/education_portal/models/__pycache__/__init__.cpython-312.pyc index fd3aad1..f896689 100644 Binary files a/addons/education_portal/models/__pycache__/__init__.cpython-312.pyc and b/addons/education_portal/models/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_portal/models/__pycache__/announcement.cpython-312.pyc b/addons/education_portal/models/__pycache__/announcement.cpython-312.pyc index 25f1cb7..5654ea7 100644 Binary files a/addons/education_portal/models/__pycache__/announcement.cpython-312.pyc and b/addons/education_portal/models/__pycache__/announcement.cpython-312.pyc differ diff --git a/addons/education_portal/models/__pycache__/fee_assignment_inherit.cpython-312.pyc b/addons/education_portal/models/__pycache__/fee_assignment_inherit.cpython-312.pyc index 18265b2..679c75c 100644 Binary files a/addons/education_portal/models/__pycache__/fee_assignment_inherit.cpython-312.pyc and b/addons/education_portal/models/__pycache__/fee_assignment_inherit.cpython-312.pyc differ diff --git a/addons/education_portal/models/__pycache__/payment_transaction.cpython-312.pyc b/addons/education_portal/models/__pycache__/payment_transaction.cpython-312.pyc index 0a66ca4..7686ffc 100644 Binary files a/addons/education_portal/models/__pycache__/payment_transaction.cpython-312.pyc and b/addons/education_portal/models/__pycache__/payment_transaction.cpython-312.pyc differ diff --git a/addons/education_portal/models/__pycache__/res_config_settings.cpython-312.pyc b/addons/education_portal/models/__pycache__/res_config_settings.cpython-312.pyc index 51c2130..69d8e73 100644 Binary files a/addons/education_portal/models/__pycache__/res_config_settings.cpython-312.pyc and b/addons/education_portal/models/__pycache__/res_config_settings.cpython-312.pyc differ diff --git a/addons/education_portal/models/__pycache__/student_inherit.cpython-312.pyc b/addons/education_portal/models/__pycache__/student_inherit.cpython-312.pyc index 2067b21..f512dc0 100644 Binary files a/addons/education_portal/models/__pycache__/student_inherit.cpython-312.pyc and b/addons/education_portal/models/__pycache__/student_inherit.cpython-312.pyc differ diff --git a/addons/education_portal/services/__pycache__/__init__.cpython-312.pyc b/addons/education_portal/services/__pycache__/__init__.cpython-312.pyc index 9abd365..494afc4 100644 Binary files a/addons/education_portal/services/__pycache__/__init__.cpython-312.pyc and b/addons/education_portal/services/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_portal/services/__pycache__/payment_service.cpython-312.pyc b/addons/education_portal/services/__pycache__/payment_service.cpython-312.pyc index 854affb..35a4cd0 100644 Binary files a/addons/education_portal/services/__pycache__/payment_service.cpython-312.pyc and b/addons/education_portal/services/__pycache__/payment_service.cpython-312.pyc differ diff --git a/addons/education_portal/services/__pycache__/razorpay_service.cpython-312.pyc b/addons/education_portal/services/__pycache__/razorpay_service.cpython-312.pyc index 7ac0c7a..a986414 100644 Binary files a/addons/education_portal/services/__pycache__/razorpay_service.cpython-312.pyc and b/addons/education_portal/services/__pycache__/razorpay_service.cpython-312.pyc differ diff --git a/addons/education_portal/services/__pycache__/reconciliation_service.cpython-312.pyc b/addons/education_portal/services/__pycache__/reconciliation_service.cpython-312.pyc index 29917b0..c6d7ecd 100644 Binary files a/addons/education_portal/services/__pycache__/reconciliation_service.cpython-312.pyc and b/addons/education_portal/services/__pycache__/reconciliation_service.cpython-312.pyc differ diff --git a/addons/education_reports/__pycache__/__init__.cpython-312.pyc b/addons/education_reports/__pycache__/__init__.cpython-312.pyc index fc0f20d..74a28f8 100644 Binary files a/addons/education_reports/__pycache__/__init__.cpython-312.pyc and b/addons/education_reports/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_reports/wizards/__pycache__/__init__.cpython-312.pyc b/addons/education_reports/wizards/__pycache__/__init__.cpython-312.pyc index db5db84..3a95771 100644 Binary files a/addons/education_reports/wizards/__pycache__/__init__.cpython-312.pyc and b/addons/education_reports/wizards/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_reports/wizards/__pycache__/report_wizard.cpython-312.pyc b/addons/education_reports/wizards/__pycache__/report_wizard.cpython-312.pyc index 6db4d2e..5f7cdb8 100644 Binary files a/addons/education_reports/wizards/__pycache__/report_wizard.cpython-312.pyc and b/addons/education_reports/wizards/__pycache__/report_wizard.cpython-312.pyc differ diff --git a/addons/education_student/__pycache__/__init__.cpython-312.pyc b/addons/education_student/__pycache__/__init__.cpython-312.pyc index e5d4a8d..fac8a44 100644 Binary files a/addons/education_student/__pycache__/__init__.cpython-312.pyc and b/addons/education_student/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_student/models/__pycache__/__init__.cpython-312.pyc b/addons/education_student/models/__pycache__/__init__.cpython-312.pyc index 45d3e26..b723c91 100644 Binary files a/addons/education_student/models/__pycache__/__init__.cpython-312.pyc and b/addons/education_student/models/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_student/models/__pycache__/academic_config.cpython-312.pyc b/addons/education_student/models/__pycache__/academic_config.cpython-312.pyc index 6b8719e..d3f5041 100644 Binary files a/addons/education_student/models/__pycache__/academic_config.cpython-312.pyc and b/addons/education_student/models/__pycache__/academic_config.cpython-312.pyc differ diff --git a/addons/education_student/models/__pycache__/student.cpython-312.pyc b/addons/education_student/models/__pycache__/student.cpython-312.pyc index 53b4559..75a2158 100644 Binary files a/addons/education_student/models/__pycache__/student.cpython-312.pyc and b/addons/education_student/models/__pycache__/student.cpython-312.pyc differ diff --git a/addons/education_timetable/__pycache__/__init__.cpython-312.pyc b/addons/education_timetable/__pycache__/__init__.cpython-312.pyc index 0fc45fc..1ab03a6 100644 Binary files a/addons/education_timetable/__pycache__/__init__.cpython-312.pyc and b/addons/education_timetable/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_timetable/controllers/__pycache__/__init__.cpython-312.pyc b/addons/education_timetable/controllers/__pycache__/__init__.cpython-312.pyc index eaf7878..585a9a4 100644 Binary files a/addons/education_timetable/controllers/__pycache__/__init__.cpython-312.pyc and b/addons/education_timetable/controllers/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_timetable/controllers/__pycache__/main.cpython-312.pyc b/addons/education_timetable/controllers/__pycache__/main.cpython-312.pyc index b398eae..16a910a 100644 Binary files a/addons/education_timetable/controllers/__pycache__/main.cpython-312.pyc and b/addons/education_timetable/controllers/__pycache__/main.cpython-312.pyc differ diff --git a/addons/education_timetable/models/__pycache__/__init__.cpython-312.pyc b/addons/education_timetable/models/__pycache__/__init__.cpython-312.pyc index fd1b90d..1b3642b 100644 Binary files a/addons/education_timetable/models/__pycache__/__init__.cpython-312.pyc and b/addons/education_timetable/models/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_timetable/models/__pycache__/education_room.cpython-312.pyc b/addons/education_timetable/models/__pycache__/education_room.cpython-312.pyc index 34621d9..5a8da63 100644 Binary files a/addons/education_timetable/models/__pycache__/education_room.cpython-312.pyc and b/addons/education_timetable/models/__pycache__/education_room.cpython-312.pyc differ diff --git a/addons/education_timetable/models/__pycache__/education_timetable_slot.cpython-312.pyc b/addons/education_timetable/models/__pycache__/education_timetable_slot.cpython-312.pyc index 159099e..3c8fd35 100644 Binary files a/addons/education_timetable/models/__pycache__/education_timetable_slot.cpython-312.pyc and b/addons/education_timetable/models/__pycache__/education_timetable_slot.cpython-312.pyc differ diff --git a/addons/education_transportation/__pycache__/__init__.cpython-312.pyc b/addons/education_transportation/__pycache__/__init__.cpython-312.pyc index 93b2e4b..ba9fbb5 100644 Binary files a/addons/education_transportation/__pycache__/__init__.cpython-312.pyc and b/addons/education_transportation/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_transportation/controllers/__pycache__/__init__.cpython-312.pyc b/addons/education_transportation/controllers/__pycache__/__init__.cpython-312.pyc index 10ee483..f8dd52d 100644 Binary files a/addons/education_transportation/controllers/__pycache__/__init__.cpython-312.pyc and b/addons/education_transportation/controllers/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_transportation/controllers/__pycache__/portal.cpython-312.pyc b/addons/education_transportation/controllers/__pycache__/portal.cpython-312.pyc index 18ae846..1a4d9a5 100644 Binary files a/addons/education_transportation/controllers/__pycache__/portal.cpython-312.pyc and b/addons/education_transportation/controllers/__pycache__/portal.cpython-312.pyc differ diff --git a/addons/education_transportation/models/__pycache__/__init__.cpython-312.pyc b/addons/education_transportation/models/__pycache__/__init__.cpython-312.pyc index d9de16d..30155fc 100644 Binary files a/addons/education_transportation/models/__pycache__/__init__.cpython-312.pyc and b/addons/education_transportation/models/__pycache__/__init__.cpython-312.pyc differ diff --git a/addons/education_transportation/models/__pycache__/assignment.cpython-312.pyc b/addons/education_transportation/models/__pycache__/assignment.cpython-312.pyc index dd12619..11116a6 100644 Binary files a/addons/education_transportation/models/__pycache__/assignment.cpython-312.pyc and b/addons/education_transportation/models/__pycache__/assignment.cpython-312.pyc differ diff --git a/addons/education_transportation/models/__pycache__/attendance.cpython-312.pyc b/addons/education_transportation/models/__pycache__/attendance.cpython-312.pyc index 3a21531..825af98 100644 Binary files a/addons/education_transportation/models/__pycache__/attendance.cpython-312.pyc and b/addons/education_transportation/models/__pycache__/attendance.cpython-312.pyc differ diff --git a/addons/education_transportation/models/__pycache__/driver.cpython-312.pyc b/addons/education_transportation/models/__pycache__/driver.cpython-312.pyc index 1f645e4..287e66b 100644 Binary files a/addons/education_transportation/models/__pycache__/driver.cpython-312.pyc and b/addons/education_transportation/models/__pycache__/driver.cpython-312.pyc differ diff --git a/addons/education_transportation/models/__pycache__/incident.cpython-312.pyc b/addons/education_transportation/models/__pycache__/incident.cpython-312.pyc index 291988b..bc9a276 100644 Binary files a/addons/education_transportation/models/__pycache__/incident.cpython-312.pyc and b/addons/education_transportation/models/__pycache__/incident.cpython-312.pyc differ diff --git a/addons/education_transportation/models/__pycache__/route.cpython-312.pyc b/addons/education_transportation/models/__pycache__/route.cpython-312.pyc index bf750de..ea157ad 100644 Binary files a/addons/education_transportation/models/__pycache__/route.cpython-312.pyc and b/addons/education_transportation/models/__pycache__/route.cpython-312.pyc differ diff --git a/addons/education_transportation/models/__pycache__/route_stop.cpython-312.pyc b/addons/education_transportation/models/__pycache__/route_stop.cpython-312.pyc index 845ca53..3d056b8 100644 Binary files a/addons/education_transportation/models/__pycache__/route_stop.cpython-312.pyc and b/addons/education_transportation/models/__pycache__/route_stop.cpython-312.pyc differ diff --git a/addons/education_transportation/models/__pycache__/stop.cpython-312.pyc b/addons/education_transportation/models/__pycache__/stop.cpython-312.pyc index 660e7cd..c9a7f63 100644 Binary files a/addons/education_transportation/models/__pycache__/stop.cpython-312.pyc and b/addons/education_transportation/models/__pycache__/stop.cpython-312.pyc differ diff --git a/addons/education_transportation/models/__pycache__/trip.cpython-312.pyc b/addons/education_transportation/models/__pycache__/trip.cpython-312.pyc index 03d908a..7c14020 100644 Binary files a/addons/education_transportation/models/__pycache__/trip.cpython-312.pyc and b/addons/education_transportation/models/__pycache__/trip.cpython-312.pyc differ diff --git a/addons/education_transportation/models/__pycache__/vehicle.cpython-312.pyc b/addons/education_transportation/models/__pycache__/vehicle.cpython-312.pyc index 1da6f0d..f492e56 100644 Binary files a/addons/education_transportation/models/__pycache__/vehicle.cpython-312.pyc and b/addons/education_transportation/models/__pycache__/vehicle.cpython-312.pyc differ diff --git a/addons/theme_student_erp_custom/__pycache__/__init__.cpython-312.pyc b/addons/theme_student_erp_custom/__pycache__/__init__.cpython-312.pyc index 93a30c1..2079040 100644 Binary files a/addons/theme_student_erp_custom/__pycache__/__init__.cpython-312.pyc and b/addons/theme_student_erp_custom/__pycache__/__init__.cpython-312.pyc differ diff --git a/admin_cookie.txt b/admin_cookie.txt new file mode 100644 index 0000000..9176cb6 --- /dev/null +++ b/admin_cookie.txt @@ -0,0 +1,5 @@ +# Netscape HTTP Cookie File +# https://curl.se/docs/http-cookies.html +# This file was generated by libcurl! Edit at your own risk. + +#HttpOnly_localhost FALSE / FALSE 1791398610 session_id QyP2Dv9gXDQDiEsdHgcts59e_0IShDwGzoEV1zGasI1Oror7_TKp7JNvwE0vfpOrmzjtG8stomCv2bGLU13R diff --git a/check.py b/check.py new file mode 100644 index 0000000..750de39 --- /dev/null +++ b/check.py @@ -0,0 +1 @@ +user = env["res.users"].search([("login", "=", "demo.student")]); student = env["education.student"].search([("id", "=", 10)]); print("USER:", user.id); print("STUDENT PORTAL USER:", student.portal_user_id.id); print("USER STUDENT_ID:", user.student_id.id) diff --git a/cookie.txt b/cookie.txt new file mode 100644 index 0000000..8027897 --- /dev/null +++ b/cookie.txt @@ -0,0 +1,5 @@ +# Netscape HTTP Cookie File +# https://curl.se/docs/http-cookies.html +# This file was generated by libcurl! Edit at your own risk. + +#HttpOnly_localhost FALSE / FALSE 1791400398 session_id -6czEnFIBCUg-AjKn1mVRwr5HWUfiuiG36uF145raY7smG8fyIWvAeSFMPc3CV5dtckCKLLSYBlDsHJfz7DI diff --git a/create_hierarchy.py b/create_hierarchy.py new file mode 100644 index 0000000..f2c9055 --- /dev/null +++ b/create_hierarchy.py @@ -0,0 +1,120 @@ +import traceback + +def get_or_create(model, domain, vals): + rec = env[model].search(domain, limit=1) + if not rec: + rec = env[model].create(vals) + print(f"Created {model}: {rec.id}") + else: + print(f"Found {model}: {rec.id}") + return rec + +try: + # 1. Company + company = env["res.company"].search([], limit=1) + + # 2. Campus + campus = get_or_create("education.campus", [("name", "=", "Test Campus")], { + "name": "Test Campus", + "company_id": company.id, + "code": "TC" + }) + + # 3. Department + dept = get_or_create("education.department", [("name", "=", "Test Dept")], { + "name": "Test Dept", + "company_id": company.id, + "campus_id": campus.id, + "code": "TD" + }) + + # 4. Academic Level + level = get_or_create("education.academic.level", [("name", "=", "Test Level")], { + "name": "Test Level", + "company_id": company.id, + "code": "TL" + }) + + # 5. Program + program = get_or_create("education.program", [("name", "=", "Test Program")], { + "name": "Test Program", + "department_id": dept.id, + "level_id": level.id, + "code": "TP" + }) + + # 6. Academic Year + year = get_or_create("education.academic.year", [("name", "=", "Test Year")], { + "name": "Test Year", + "company_id": company.id, + "start_date": "2026-01-01", + "end_date": "2026-12-31" + }) + + # 7. Academic Term + term = get_or_create("education.academic.term", [("name", "=", "Test Term")], { + "name": "Test Term", + "academic_year_id": year.id, + "start_date": "2026-01-01", + "end_date": "2026-06-30" + }) + + # 8. Batch + batch = get_or_create("education.batch", [("name", "=", "Test Batch")], { + "name": "Test Batch", + "program_id": program.id, + "academic_year_id": year.id, + "start_date": "2026-01-01", + "end_date": "2026-12-31" + }) + + # 9. Semester + semester = get_or_create("education.semester", [("name", "=", "Test Semester")], { + "name": "Test Semester", + "program_id": program.id, + "academic_year_id": year.id, + "sequence": 1 + }) + + # res.users (demo.student) + user = env["res.users"].search([("login", "=", "demo.student")], limit=1) + + # 10. Student + student = env["education.student"].search([("portal_user_id", "=", user.id)], limit=1) + if not student: + student = env["education.student"].create({ + "full_name": "Demo Student", + "first_name": "Demo", + "last_name": "Student", + "email": "demo.student@example.com", + "portal_user_id": user.id, + "company_id": company.id, + "campus_id": campus.id, + "department_id": dept.id, + "level_id": level.id, + "program_id": program.id, + "academic_year_id": year.id, + "academic_term_id": term.id, + "batch_id": batch.id, + "semester_id": semester.id, + "current_semester_id": semester.id, + "date_of_birth": "2000-01-01", + "gender": "other", + "admission_number": "ADM-9999", + "student_id": "STU-9999", + "status": "active" + }) + print(f"Created Student: {student.id}") + else: + print(f"Found Student: {student.id}") + + env.cr.commit() + with open('/mnt/extra-addons/success.log', 'w') as f: + f.write(f"ALL DONE. Student ID: {student.id}\n") + print("SUCCESS") + +except Exception as e: + print("FAILED") + traceback.print_exc() + with open('/mnt/extra-addons/error.log', 'w') as f: + f.write(traceback.format_exc()) diff --git a/create_student.py b/create_student.py new file mode 100644 index 0000000..15eb9f6 --- /dev/null +++ b/create_student.py @@ -0,0 +1,11 @@ +user = env["res.users"].search([("login", "=", "demo.student")], limit=1) +if user: + student = env["education.student"].create({ + "full_name": "Demo Student", + "first_name": "Demo", + "last_name": "Student", + "email": "demo.student@example.com", + "portal_user_id": user.id, + }) + env.cr.commit() + print("CREATED STUDENT ID:", student.id, "LINKED TO USER ID:", user.id) diff --git a/create_student_debug.py b/create_student_debug.py new file mode 100644 index 0000000..f9e3713 --- /dev/null +++ b/create_student_debug.py @@ -0,0 +1,36 @@ +import traceback +try: + campus = env["education.campus"].search([], limit=1) + if not campus: + campus = env["education.campus"].create({"name": "Test Campus"}) + dept = env["education.department"].search([], limit=1) + if not dept: + dept = env["education.department"].create({"name": "Test Dept"}) + prog = env["education.program"].search([], limit=1) + if not prog: + prog = env["education.program"].create({"name": "Test Program"}) + year = env["education.academic.year"].search([], limit=1) + if not year: + year = env["education.academic.year"].create({"name": "2026"}) + user = env["res.users"].search([("login", "=", "demo.student")], limit=1) + + student = env["education.student"].create({ + "full_name": "Demo Student", + "first_name": "Demo", + "last_name": "Student", + "email": "demo.student@example.com", + "portal_user_id": user.id if user else False, + "campus_id": campus.id, + "department_id": dept.id, + "program_id": prog.id, + "academic_year_id": year.id, + "date_of_birth": "2000-01-01", + "gender": "other", + "admission_number": "ADM-9999", + "student_id": "STU-9999" + }) + env.cr.commit() + print("SUCCESS, STUDENT ID:", student.id) +except Exception as e: + print("ERROR DURING CREATE:") + traceback.print_exc() diff --git a/create_student_file.py b/create_student_file.py new file mode 100644 index 0000000..9232ed2 --- /dev/null +++ b/create_student_file.py @@ -0,0 +1,39 @@ +import traceback +with open('/tmp/student_create.log', 'w') as f: + try: + campus = env["education.campus"].search([], limit=1) + if not campus: + campus = env["education.campus"].create({"name": "Test Campus"}) + dept = env["education.department"].search([], limit=1) + if not dept: + dept = env["education.department"].create({"name": "Test Dept"}) + prog = env["education.program"].search([], limit=1) + if not prog: + prog = env["education.program"].create({"name": "Test Program"}) + year = env["education.academic.year"].search([], limit=1) + if not year: + year = env["education.academic.year"].create({"name": "2026"}) + user = env["res.users"].search([("login", "=", "demo.student")], limit=1) + + f.write(f"Campus: {campus.id}, Dept: {dept.id}, Prog: {prog.id}, Year: {year.id}, User: {user.id}\n") + + student = env["education.student"].create({ + "full_name": "Demo Student", + "first_name": "Demo", + "last_name": "Student", + "email": "demo.student@example.com", + "portal_user_id": user.id if user else False, + "campus_id": campus.id, + "department_id": dept.id, + "program_id": prog.id, + "academic_year_id": year.id, + "date_of_birth": "2000-01-01", + "gender": "other", + "admission_number": "ADM-9999", + "student_id": "STU-9999" + }) + env.cr.commit() + f.write(f"SUCCESS, STUDENT ID: {student.id}\n") + except Exception as e: + f.write("ERROR DURING CREATE:\n") + f.write(traceback.format_exc()) diff --git a/create_student_full.py b/create_student_full.py new file mode 100644 index 0000000..868efb5 --- /dev/null +++ b/create_student_full.py @@ -0,0 +1,23 @@ +campus = env["education.campus"].search([], limit=1) +dept = env["education.department"].search([], limit=1) +prog = env["education.program"].search([], limit=1) +year = env["education.academic.year"].search([], limit=1) +user = env["res.users"].search([("login", "=", "demo.student")], limit=1) +if user and campus and dept and prog and year: + student = env["education.student"].create({ + "full_name": "Demo Student", + "first_name": "Demo", + "last_name": "Student", + "email": "demo.student@example.com", + "portal_user_id": user.id, + "campus_id": campus.id, + "department_id": dept.id, + "program_id": prog.id, + "academic_year_id": year.id, + "date_of_birth": "2000-01-01", + "gender": "other", + "admission_number": "ADM-9999", + "student_id": "STU-9999" + }) + env.cr.commit() + print("CREATED FULL STUDENT:", student.id) diff --git a/create_student_full2.py b/create_student_full2.py new file mode 100644 index 0000000..a03de90 --- /dev/null +++ b/create_student_full2.py @@ -0,0 +1,30 @@ +campus = env["education.campus"].search([], limit=1) +if not campus: + campus = env["education.campus"].create({"name": "Test Campus"}) +dept = env["education.department"].search([], limit=1) +if not dept: + dept = env["education.department"].create({"name": "Test Dept"}) +prog = env["education.program"].search([], limit=1) +if not prog: + prog = env["education.program"].create({"name": "Test Program"}) +year = env["education.academic.year"].search([], limit=1) +if not year: + year = env["education.academic.year"].create({"name": "2026"}) +user = env["res.users"].search([("login", "=", "demo.student")], limit=1) +if user: + student = env["education.student"].create({ + "full_name": "Demo Student", + "first_name": "Demo", + "last_name": "Student", + "email": "demo.student@example.com", + "portal_user_id": user.id, + "campus_id": campus.id, + "department_id": dept.id, + "program_id": prog.id, + "academic_year_id": year.id, + "date_of_birth": "2000-01-01", + "gender": "other", + "admission_number": "ADM-9999", + "student_id": "STU-9999" + }) + env.cr.commit() diff --git a/debug_student.py b/debug_student.py new file mode 100644 index 0000000..84a5cb4 --- /dev/null +++ b/debug_student.py @@ -0,0 +1,4 @@ +user = env["res.users"].search([("login", "=", "demo.student")], limit=1) +print("USER:", user.id) +print("STUDENTS:", user.student_ids.ids) +print("PROPERTY:", user.student_id) diff --git a/docker-compose.yml b/docker-compose.yml index f91c3eb..2f5ec6d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,7 +22,7 @@ services: USER: odoo PASSWORD: odoo LIST_DB: "True" - command: odoo --proxy-mode -i education_base,education_student,education_attendance,education_finance,education_dashboard,education_exam,education_lms,education_portal,education_reports,education_timetable,education_hostel,education_transportation,education_demo_data + command: odoo --proxy-mode -i education_base,education_student,education_attendance,education_finance,education_dashboard,education_exam,education_lms,education_portal,education_reports,education_timetable,education_hostel,education_transportation,education_demo_data,education_mobile_api volumes: - client1_odoo_data:/var/lib/odoo - ./addons:/mnt/extra-addons diff --git a/fix_demo_data.py b/fix_demo_data.py new file mode 100644 index 0000000..1caa678 --- /dev/null +++ b/fix_demo_data.py @@ -0,0 +1,12 @@ +import sys +sys.path.append("/mnt/extra-addons") +sys.path.append("/usr/lib/python3/dist-packages/odoo/addons") +from education_demo_data.demo_data_generator import generate_demo_data + +try: + generate_demo_data(env) + print("DEMO DATA GENERATED SUCCESSFULLY") +except Exception as e: + import traceback + traceback.print_exc() + diff --git a/force_create.py b/force_create.py new file mode 100644 index 0000000..b2c9f2a --- /dev/null +++ b/force_create.py @@ -0,0 +1,43 @@ +import sys +import traceback +try: + user = env["res.users"].search([("login", "=", "demo.student")], limit=1) + + c = env["res.company"].search([], limit=1) + campus = env["education.campus"].search([], limit=1) or env["education.campus"].create({"name": "Test", "company_id": c.id}) + dept = env["education.department"].search([], limit=1) or env["education.department"].create({"name": "Test", "company_id": c.id, "campus_id": campus.id}) + level = env["education.academic.level"].search([], limit=1) or env["education.academic.level"].create({"name": "Test", "company_id": c.id}) + prog = env["education.program"].search([], limit=1) or env["education.program"].create({"name": "Test", "code": "T", "department_id": dept.id, "level_id": level.id}) + year = env["education.academic.year"].search([], limit=1) or env["education.academic.year"].create({"name": "Test", "company_id": c.id, "start_date": "2026-01-01", "end_date": "2026-12-31"}) + term = env["education.academic.term"].search([], limit=1) or env["education.academic.term"].create({"name": "Test", "academic_year_id": year.id, "start_date": "2026-01-01", "end_date": "2026-12-31"}) + batch = env["education.batch"].search([], limit=1) or env["education.batch"].create({"name": "Test", "program_id": prog.id, "academic_year_id": year.id}) + sem = env["education.semester"].search([], limit=1) or env["education.semester"].create({"name": "Test", "program_id": prog.id, "academic_year_id": year.id, "sequence": 1}) + + student = env["education.student"].create({ + "full_name": "Demo Student", + "first_name": "Demo", + "last_name": "Student", + "email": "demo.student@example.com", + "portal_user_id": user.id, + "company_id": c.id, + "campus_id": campus.id, + "department_id": dept.id, + "level_id": level.id, + "program_id": prog.id, + "academic_year_id": year.id, + "academic_term_id": term.id, + "batch_id": batch.id, + "semester_id": sem.id, + "current_semester_id": sem.id, + "date_of_birth": "2000-01-01", + "gender": "other", + "admission_number": "ADM-9999", + "student_id": "STU-9999", + "status": "active" + }) + env.cr.commit() + with open('/mnt/extra-addons/error.log', 'w') as f: + f.write("SUCCESS: " + str(student.id)) +except Exception as e: + with open('/mnt/extra-addons/error.log', 'w') as f: + f.write(traceback.format_exc()) diff --git a/link.py b/link.py new file mode 100644 index 0000000..68cf826 --- /dev/null +++ b/link.py @@ -0,0 +1 @@ +user = env["res.users"].search([("login", "=", "demo.student")]); env["education.student"].search([], limit=1).write({"portal_user_id": user.id}); env.cr.commit() diff --git a/run_demo.py b/run_demo.py new file mode 100644 index 0000000..291b525 --- /dev/null +++ b/run_demo.py @@ -0,0 +1,7 @@ +import traceback +try: + from odoo.addons.education_demo_data.demo_data_generator import generate_demo_data + generate_demo_data(env) + print("DEMO_GEN_SUCCESS") +except Exception: + traceback.print_exc() diff --git a/setup_demo_student.py b/setup_demo_student.py new file mode 100644 index 0000000..8ad0484 --- /dev/null +++ b/setup_demo_student.py @@ -0,0 +1,15 @@ +user = env["res.users"].search([("login", "=", "demo.student")], limit=1) +if user: + student = env["education.student"].search([], limit=1) + if student: + student.write({"portal_user_id": user.id}) + env.cr.commit() + print("LINKED STUDENT ID:", student.id, "TO USER ID:", user.id) + else: + print("NO STUDENT FOUND") +else: + print("NO USER FOUND") + +print("USER:", user.id) +print("USER STUDENT:", user.student_id.id) +print("STUDENT NAME:", user.student_id.full_name) diff --git a/verify_student.py b/verify_student.py new file mode 100644 index 0000000..d94b2ed --- /dev/null +++ b/verify_student.py @@ -0,0 +1,4 @@ +user = env["res.users"].search([("login", "=", "demo.student")], limit=1) +print("USER:", user.id) +print("USER STUDENT:", user.student_id.id) +print("STUDENT NAME:", user.student_id.full_name)