@ -0,0 +1,47 @@ | 
				
			|||||
 | 
					.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg | 
				
			||||
 | 
					    :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html | 
				
			||||
 | 
					    :alt: License: AGPL-3 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					University Education Management | 
				
			||||
 | 
					=============================== | 
				
			||||
 | 
					A strong and complete user-friendly ERP solution designed specifically for college administration is University Educational ERP. Details such as student entrance, enrollment information, faculty records, class management, and subject administration are simple to administer. | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					Configuration | 
				
			||||
 | 
					============= | 
				
			||||
 | 
					No additional configuration required | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					Company | 
				
			||||
 | 
					------- | 
				
			||||
 | 
					* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					License | 
				
			||||
 | 
					------- | 
				
			||||
 | 
					Affero General Public License v3.0 (AGPL v3) | 
				
			||||
 | 
					(https://www.gnu.org/licenses/agpl-3.0-standalone.html) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					Credits | 
				
			||||
 | 
					------ | 
				
			||||
 | 
					Developer : (V16) Raneesha M K, Contact : odoo@cybrosys.com | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					Contacts | 
				
			||||
 | 
					-------- | 
				
			||||
 | 
					* Mail Contact : odoo@cybrosys.com | 
				
			||||
 | 
					* Website : https://cybrosys.com | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					Bug Tracker | 
				
			||||
 | 
					----------- | 
				
			||||
 | 
					Bugs are tracked on GitHub Issues. In case of trouble, please check there if | 
				
			||||
 | 
					your issue has already been reported. | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					Maintainer | 
				
			||||
 | 
					========== | 
				
			||||
 | 
					.. image:: https://cybrosys.com/images/logo.png | 
				
			||||
 | 
					   :target: https://cybrosys.com | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					This module is maintained by Cybrosys Technologies. | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					For support and more information, please visit `Our Website <https://cybrosys.com/>`__ | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					Further information | 
				
			||||
 | 
					=================== | 
				
			||||
 | 
					HTML Description: `<static/description/index.html>`__ | 
				
			||||
@ -0,0 +1,24 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from . import controllers | 
				
			||||
 | 
					from . import models | 
				
			||||
 | 
					from . import wizard | 
				
			||||
@ -0,0 +1,87 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					{ | 
				
			||||
 | 
					    'name': ' University Education Management', | 
				
			||||
 | 
					    'version': '16.0.1.0.0', | 
				
			||||
 | 
					    'category': 'Industries', | 
				
			||||
 | 
					    'summary': """This modules helps to manage the university  | 
				
			||||
 | 
					     education system""", | 
				
			||||
 | 
					    'description': """This module serves as a comprehensive solution for | 
				
			||||
 | 
					     efficiently managing the education system of a university enhancing | 
				
			||||
 | 
					     its overall functionality and user experience.""", | 
				
			||||
 | 
					    'author': 'Cybrosys Techno Solutions', | 
				
			||||
 | 
					    'company': 'Cybrosys Techno Solutions', | 
				
			||||
 | 
					    'maintainer': 'Cybrosys Techno Solutions', | 
				
			||||
 | 
					    'website': 'https://www.cybrosys.com', | 
				
			||||
 | 
					    'depends': ['mail', 'hr_recruitment', 'account', 'website'], | 
				
			||||
 | 
					    'data': [ | 
				
			||||
 | 
					        'security/education_university_management_groups.xml', | 
				
			||||
 | 
					        'security/ir.model.access.csv', | 
				
			||||
 | 
					        'data/ir_sequence_data.xml', | 
				
			||||
 | 
					        'data/online_application_menu_data.xml', | 
				
			||||
 | 
					        'data/mail_template_data.xml', | 
				
			||||
 | 
					        'wizard/application_reject_views.xml', | 
				
			||||
 | 
					        'views/education_university_management_menus.xml', | 
				
			||||
 | 
					        'views/res_partner_views.xml', | 
				
			||||
 | 
					        'views/fee_category_views.xml', | 
				
			||||
 | 
					        'views/account_journal_views.xml', | 
				
			||||
 | 
					        'views/fee_types_views.xml', | 
				
			||||
 | 
					        'views/fee_structure_views.xml', | 
				
			||||
 | 
					        'views/account_move_views.xml', | 
				
			||||
 | 
					        'views/timetable_period_views.xml', | 
				
			||||
 | 
					        'views/university_exam_type_views.xml', | 
				
			||||
 | 
					        'views/university_exam_views.xml', | 
				
			||||
 | 
					        'views/exam_valuation_views.xml', | 
				
			||||
 | 
					        'views/exam_result_views.xml', | 
				
			||||
 | 
					        'views/university_timetable_views.xml', | 
				
			||||
 | 
					        'views/timetable_schedule_line_views.xml', | 
				
			||||
 | 
					        'views/university_application_views.xml', | 
				
			||||
 | 
					        'views/university_attendace_views.xml', | 
				
			||||
 | 
					        'views/university_attendance_line_views.xml', | 
				
			||||
 | 
					        'views/university_student_views.xml', | 
				
			||||
 | 
					        'views/university_document_type_views.xml', | 
				
			||||
 | 
					        'views/university_document_views.xml', | 
				
			||||
 | 
					        'views/reject_reason_views.xml', | 
				
			||||
 | 
					        'views/university_course_views.xml', | 
				
			||||
 | 
					        'views/university_department_views.xml', | 
				
			||||
 | 
					        'views/university_subject_views.xml', | 
				
			||||
 | 
					        'views/university_semester_views.xml', | 
				
			||||
 | 
					        'views/university_syllabus_views.xml', | 
				
			||||
 | 
					        'views/university_academic_year_views.xml', | 
				
			||||
 | 
					        'views/university_batch_views.xml', | 
				
			||||
 | 
					        'views/university_faculty_views.xml', | 
				
			||||
 | 
					        'views/student_portal_templates.xml', | 
				
			||||
 | 
					        'views/online_application_templates.xml', | 
				
			||||
 | 
					    ], | 
				
			||||
 | 
					    'demo': ['demo/education_university_management_demo.xml'], | 
				
			||||
 | 
					    'assets': { | 
				
			||||
 | 
					        'web.assets_frontend': [ | 
				
			||||
 | 
					            '/education_university_management/static/src/css/web_style.css', | 
				
			||||
 | 
					            '/education_university_management/static/src/js/online_application.js' | 
				
			||||
 | 
					        ], | 
				
			||||
 | 
					    }, | 
				
			||||
 | 
					    'images': ['static/description/banner.jpg'], | 
				
			||||
 | 
					    'license': 'AGPL-3', | 
				
			||||
 | 
					    'installable': True, | 
				
			||||
 | 
					    'auto_install': False, | 
				
			||||
 | 
					    'application': True, | 
				
			||||
 | 
					} | 
				
			||||
@ -0,0 +1,23 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from . import education_online_application | 
				
			||||
 | 
					from . import education_university_management | 
				
			||||
@ -0,0 +1,93 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					import base64 | 
				
			||||
 | 
					from odoo import http | 
				
			||||
 | 
					from odoo.http import request | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class OnlineAdmission(http.Controller): | 
				
			||||
 | 
					    """Controller for taking online admission""" | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @http.route('/university', type='http', auth='public', website=True) | 
				
			||||
 | 
					    def university_contact_us(self): | 
				
			||||
 | 
					        """To redirect to contact page.""" | 
				
			||||
 | 
					        return request.render('education_university_management.university') | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @http.route('/applyonline', type='http', auth='public', website=True) | 
				
			||||
 | 
					    def online_admission(self): | 
				
			||||
 | 
					        """To pass certain default field values | 
				
			||||
 | 
					                                    to the website registration form.""" | 
				
			||||
 | 
					        vals = { | 
				
			||||
 | 
					            'department': request.env['university.department'].sudo().search( | 
				
			||||
 | 
					                []), | 
				
			||||
 | 
					            'course': request.env['university.course'].sudo().search([]), | 
				
			||||
 | 
					            'semester': request.env['university.semester'].sudo().search([]), | 
				
			||||
 | 
					            'year': request.env['university.academic.year'].sudo().search([]), | 
				
			||||
 | 
					            'doc_type': request.env['university.document.type'].sudo().search([ | 
				
			||||
 | 
					                                ]) | 
				
			||||
 | 
					        } | 
				
			||||
 | 
					        return request.render( | 
				
			||||
 | 
					            'education_university_management.online_admission', | 
				
			||||
 | 
					            vals) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @http.route('/admission/submit', type='http', auth='public', | 
				
			||||
 | 
					                website=True) | 
				
			||||
 | 
					    def register_admission(self, **vals): | 
				
			||||
 | 
					        """ This will create a new student application with the values.""" | 
				
			||||
 | 
					        if vals: | 
				
			||||
 | 
					            guardian = request.env['res.partner'].sudo().create({ | 
				
			||||
 | 
					                'name': vals.get('father'), | 
				
			||||
 | 
					                'is_parent': True | 
				
			||||
 | 
					            }) | 
				
			||||
 | 
					            application = request.env[ | 
				
			||||
 | 
					                'university.application'].sudo().create({ | 
				
			||||
 | 
					                    'name': vals.get('first_name'), | 
				
			||||
 | 
					                    'last_name': vals.get('last_name'), | 
				
			||||
 | 
					                    'mother_name': vals.get('mother'), | 
				
			||||
 | 
					                    'father_name': vals.get('father'), | 
				
			||||
 | 
					                    'mobile': vals.get('phone'), | 
				
			||||
 | 
					                    'email': vals.get('email'), | 
				
			||||
 | 
					                    'date_of_birth': vals.get('date'), | 
				
			||||
 | 
					                    'academic_year_id': vals.get('academic_year'), | 
				
			||||
 | 
					                    'mother_tongue': vals.get('tongue'), | 
				
			||||
 | 
					                    'course_id': vals.get('course'), | 
				
			||||
 | 
					                    'department_id': vals.get('department'), | 
				
			||||
 | 
					                    'semester_id': vals.get('semester'), | 
				
			||||
 | 
					                    'street': vals.get('communication_address'), | 
				
			||||
 | 
					                    'per_street': vals.get('communication_address'), | 
				
			||||
 | 
					                    'guardian_id': guardian.id, | 
				
			||||
 | 
					                    'image': base64.b64encode((vals.get('image')).read()) | 
				
			||||
 | 
					                }) | 
				
			||||
 | 
					            doc_attachment = request.env['ir.attachment'].sudo().create({ | 
				
			||||
 | 
					                'name': vals.get('doc').filename, | 
				
			||||
 | 
					                'res_name': 'Document', | 
				
			||||
 | 
					                'type': 'binary', | 
				
			||||
 | 
					                'datas': base64.encodebytes((vals.get('doc')).read()), | 
				
			||||
 | 
					            }) | 
				
			||||
 | 
					            request.env['university.document'].sudo().create({ | 
				
			||||
 | 
					                'document_type_id': vals.get('doc_type'), | 
				
			||||
 | 
					                'attachment_ids': doc_attachment, | 
				
			||||
 | 
					                'application_ref_id': application.id | 
				
			||||
 | 
					            }) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					        return request.render( | 
				
			||||
 | 
					            "education_university_management.submit_admission", {}) | 
				
			||||
@ -0,0 +1,114 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import http | 
				
			||||
 | 
					from odoo.http import request, route | 
				
			||||
 | 
					from odoo.addons.portal.controllers.portal import CustomerPortal | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class StudentPortal(CustomerPortal): | 
				
			||||
 | 
					    """Controller for creating a new portal design for student users""" | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @http.route(['/home'], type='http', auth="user", website=True) | 
				
			||||
 | 
					    def student_portal(self): | 
				
			||||
 | 
					        """New portal for student users""" | 
				
			||||
 | 
					        return request.render("education_university_management.student_portal") | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @http.route(['/student/info'], type='http', auth="user", website=True) | 
				
			||||
 | 
					    def student_info(self): | 
				
			||||
 | 
					        """Get basic details of students in the university""" | 
				
			||||
 | 
					        values = request.env['university.student'].sudo().search( | 
				
			||||
 | 
					            [('partner_id', '=', request.env.user.partner_id.id)]) | 
				
			||||
 | 
					        full_name = values.name | 
				
			||||
 | 
					        if values.middle_name: | 
				
			||||
 | 
					            full_name = full_name + ' ' + values.middle_name | 
				
			||||
 | 
					        if values.last_name: | 
				
			||||
 | 
					            full_name = full_name + ' ' + values.last_name | 
				
			||||
 | 
					        if values.gender == 'female': | 
				
			||||
 | 
					            gender = 'Female' | 
				
			||||
 | 
					        elif values.gender == 'male': | 
				
			||||
 | 
					            gender = 'Male' | 
				
			||||
 | 
					        else: | 
				
			||||
 | 
					            gender = 'Other' | 
				
			||||
 | 
					        vals = { | 
				
			||||
 | 
					            'full_name': full_name, | 
				
			||||
 | 
					            'student': values, | 
				
			||||
 | 
					            'gender': gender, | 
				
			||||
 | 
					        } | 
				
			||||
 | 
					        return request.render("education_university_management.student_info", | 
				
			||||
 | 
					                              {'values': vals}) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @http.route(['/student/documents'], type='http', auth="user", website=True) | 
				
			||||
 | 
					    def student_documents(self): | 
				
			||||
 | 
					        """Get documents of students in the university""" | 
				
			||||
 | 
					        student = request.env['university.student'].sudo().search([( | 
				
			||||
 | 
					            'partner_id', | 
				
			||||
 | 
					            '=', | 
				
			||||
 | 
					            request.env.user.partner_id.id)]).application_id | 
				
			||||
 | 
					        docs = request.env['university.document'].sudo().search( | 
				
			||||
 | 
					            [('application_ref_id', '=', student.id)]) | 
				
			||||
 | 
					        attachment = request.env['ir.attachment'].sudo().browse( | 
				
			||||
 | 
					            docs.attachment_ids.ids) | 
				
			||||
 | 
					        attachment.public = True | 
				
			||||
 | 
					        return request.render( | 
				
			||||
 | 
					            "education_university_management.student_documents", | 
				
			||||
 | 
					            {'docs': docs}) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @http.route(['/student/exam/results'], type='http', auth="user", | 
				
			||||
 | 
					                website=True) | 
				
			||||
 | 
					    def student_exam_result(self): | 
				
			||||
 | 
					        """Get exam results of students in the university""" | 
				
			||||
 | 
					        student = request.env['university.student'].sudo().search( | 
				
			||||
 | 
					            [('partner_id', '=', request.env.user.partner_id.id)]) | 
				
			||||
 | 
					        exam = request.env['exam.result'].sudo().search( | 
				
			||||
 | 
					            [('student_id', '=', student.id)]) | 
				
			||||
 | 
					        return request.render( | 
				
			||||
 | 
					            "education_university_management.student_exam_result", | 
				
			||||
 | 
					            {'data': exam}) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @http.route(['/student/result'], type='http', auth="user", | 
				
			||||
 | 
					                website=True) | 
				
			||||
 | 
					    def exam_subject(self): | 
				
			||||
 | 
					        """Get subject wise exam results of students in the university""" | 
				
			||||
 | 
					        student = request.env['university.student'].sudo().search([( | 
				
			||||
 | 
					            'partner_id', | 
				
			||||
 | 
					            '=', | 
				
			||||
 | 
					            request.env.user.partner_id.id)]) | 
				
			||||
 | 
					        exam = request.env['exam.result'].sudo().search( | 
				
			||||
 | 
					            [('student_id', '=', student.id)]) | 
				
			||||
 | 
					        line = request.env['results.subject.line'].sudo().search( | 
				
			||||
 | 
					            [('result_id', '=', exam.id)]) | 
				
			||||
 | 
					        data = { | 
				
			||||
 | 
					            'exam': exam, | 
				
			||||
 | 
					            'line': line | 
				
			||||
 | 
					        } | 
				
			||||
 | 
					        return request.render( | 
				
			||||
 | 
					            "education_university_management.student_result", data) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @route(['/my', '/my/home'], type='http', auth="user", website=True) | 
				
			||||
 | 
					    def home(self, **kw): | 
				
			||||
 | 
					        """ Overrided If the logged in user is a student, | 
				
			||||
 | 
					                           they will be directed to the student portal.""" | 
				
			||||
 | 
					        values = self._prepare_portal_layout_values() | 
				
			||||
 | 
					        if not request.env.user.partner_id.is_student: | 
				
			||||
 | 
					            return request.render("portal.portal_my_home", values) | 
				
			||||
 | 
					        else: | 
				
			||||
 | 
					            return request.redirect('/home') | 
				
			||||
@ -0,0 +1,32 @@ | 
				
			|||||
 | 
					<?xml version="1.0" encoding="utf-8"?> | 
				
			||||
 | 
					<odoo> | 
				
			||||
 | 
					    <data noupdate="1"> | 
				
			||||
 | 
					        <!-- Sequences for university.document --> | 
				
			||||
 | 
					        <record id="seq_student_documents" model="ir.sequence"> | 
				
			||||
 | 
					            <field name="name">Student Documents</field> | 
				
			||||
 | 
					            <field name="code">university.document</field> | 
				
			||||
 | 
					            <field name="prefix">DOC/%(range_year)s/</field> | 
				
			||||
 | 
					            <field eval="1" name="number_next"/> | 
				
			||||
 | 
					            <field eval="1" name="number_increment"/> | 
				
			||||
 | 
					            <field eval="True" name="use_date_range"/> | 
				
			||||
 | 
					            <field name="padding">3</field> | 
				
			||||
 | 
					            <field name="company_id" eval="False"/> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!-- Sequences for university.application --> | 
				
			||||
 | 
					        <record id="seq_student_application" model="ir.sequence"> | 
				
			||||
 | 
					            <field name="name">Student Application</field> | 
				
			||||
 | 
					            <field name="code">university.application</field> | 
				
			||||
 | 
					            <field name="prefix">SA</field> | 
				
			||||
 | 
					            <field name="padding">3</field> | 
				
			||||
 | 
					            <field name="company_id" eval="False"/> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					         <!-- Sequences for university.student --> | 
				
			||||
 | 
					        <record id="seq_students" model="ir.sequence"> | 
				
			||||
 | 
					            <field name="name">Student</field> | 
				
			||||
 | 
					            <field name="code">university.student</field> | 
				
			||||
 | 
					            <field name="prefix"></field> | 
				
			||||
 | 
					            <field name="padding">4</field> | 
				
			||||
 | 
					            <field name="company_id" eval="False"/> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					    </data> | 
				
			||||
 | 
					</odoo> | 
				
			||||
@ -0,0 +1,279 @@ | 
				
			|||||
 | 
					<?xml version="1.0" encoding="utf-8"?> | 
				
			||||
 | 
					<odoo> | 
				
			||||
 | 
					    <!-- This file is used for updating signup mail template for students also --> | 
				
			||||
 | 
					    <function name="write" model="ir.model.data"> | 
				
			||||
 | 
					        <function name="search" model="ir.model.data"> | 
				
			||||
 | 
					            <value eval="[('name', '=', 'set_password_email'), ('module', '=', 'auth_signup')]"/> | 
				
			||||
 | 
					        </function> | 
				
			||||
 | 
					        <value eval="{'noupdate': False}"/> | 
				
			||||
 | 
					    </function> | 
				
			||||
 | 
					    <record id="auth_signup.set_password_email" model="mail.template"> | 
				
			||||
 | 
					        <field name="body_html" type="html"> | 
				
			||||
 | 
					            <table border="0" cellpadding="0" cellspacing="0" | 
				
			||||
 | 
					                   style="padding-top: 16px; background-color: #FFFFFF; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"> | 
				
			||||
 | 
					                <tr> | 
				
			||||
 | 
					                    <td align="center"> | 
				
			||||
 | 
					                        <table border="0" cellpadding="0" cellspacing="0" | 
				
			||||
 | 
					                               width="590" | 
				
			||||
 | 
					                               style="padding: 16px; background-color: #FFFFFF; color: #454748; border-collapse:separate;"> | 
				
			||||
 | 
					                            <tbody> | 
				
			||||
 | 
					                                <!-- HEADER --> | 
				
			||||
 | 
					                                <tr> | 
				
			||||
 | 
					                                    <td align="center" | 
				
			||||
 | 
					                                        style="min-width: 590px;"> | 
				
			||||
 | 
					                                        <table border="0" cellpadding="0" | 
				
			||||
 | 
					                                               cellspacing="0" width="590" | 
				
			||||
 | 
					                                               style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;"> | 
				
			||||
 | 
					                                            <tr> | 
				
			||||
 | 
					                                                <td valign="middle"> | 
				
			||||
 | 
					                                                    <span style="font-size: 10px;"> | 
				
			||||
 | 
					                                                        Welcome to Odoo | 
				
			||||
 | 
					                                                    </span> | 
				
			||||
 | 
					                                                    <br/> | 
				
			||||
 | 
					                                                    <span style="font-size: 20px; font-weight: bold;"> | 
				
			||||
 | 
					                                                        <t t-out="object.name or ''"> | 
				
			||||
 | 
					                                                            Marc Demo | 
				
			||||
 | 
					                                                        </t> | 
				
			||||
 | 
					                                                    </span> | 
				
			||||
 | 
					                                                </td> | 
				
			||||
 | 
					                                                <td valign="middle" | 
				
			||||
 | 
					                                                    align="right"> | 
				
			||||
 | 
					                                                    <img t-attf-src="/logo.png?company={{ object.company_id.id }}" | 
				
			||||
 | 
					                                                         style="padding: 0px; margin: 0px; height: auto; width: 80px;" | 
				
			||||
 | 
					                                                         t-att-alt="object.company_id.name"/> | 
				
			||||
 | 
					                                                </td> | 
				
			||||
 | 
					                                            </tr> | 
				
			||||
 | 
					                                            <tr> | 
				
			||||
 | 
					                                                <td colspan="2" | 
				
			||||
 | 
					                                                    style="text-align:center;"> | 
				
			||||
 | 
					                                                    <hr width="100%" | 
				
			||||
 | 
					                                                        style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"/> | 
				
			||||
 | 
					                                                </td> | 
				
			||||
 | 
					                                            </tr> | 
				
			||||
 | 
					                                        </table> | 
				
			||||
 | 
					                                    </td> | 
				
			||||
 | 
					                                </tr> | 
				
			||||
 | 
					                                <!-- CONTENT --> | 
				
			||||
 | 
					                                <tr> | 
				
			||||
 | 
					                                    <td align="center" | 
				
			||||
 | 
					                                        style="min-width: 590px;"> | 
				
			||||
 | 
					                                        <table border="0" cellpadding="0" | 
				
			||||
 | 
					                                               cellspacing="0" width="590" | 
				
			||||
 | 
					                                               style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;"> | 
				
			||||
 | 
					                                            <t t-if="object.partner_id.is_student"> | 
				
			||||
 | 
					                                                <tr> | 
				
			||||
 | 
					                                                    <td valign="top" | 
				
			||||
 | 
					                                                        style="font-size: 13px;"> | 
				
			||||
 | 
					                                                        <div> | 
				
			||||
 | 
					                                                            Dear <t | 
				
			||||
 | 
					                                                                t-out="object.name or ''"> | 
				
			||||
 | 
					                                                            Marc Demo</t>, | 
				
			||||
 | 
					                                                            <br/> | 
				
			||||
 | 
					                                                            <br/> | 
				
			||||
 | 
					                                                            You have been | 
				
			||||
 | 
					                                                            invited by <t | 
				
			||||
 | 
					                                                                t-out="object.create_uid.name or ''"> | 
				
			||||
 | 
					                                                            OdooBot | 
				
			||||
 | 
					                                                        </t> to connect on Odoo | 
				
			||||
 | 
					                                                            Student Portal. | 
				
			||||
 | 
					                                                            <br/> | 
				
			||||
 | 
					                                                            <br/> | 
				
			||||
 | 
					                                                            <br/> | 
				
			||||
 | 
					                                                            Your sign in email | 
				
			||||
 | 
					                                                            is: | 
				
			||||
 | 
					                                                            <b> | 
				
			||||
 | 
					                                                                <a t-attf-href="/web/login?login={{ object.email }}" | 
				
			||||
 | 
					                                                                   target="_blank" | 
				
			||||
 | 
					                                                                   t-out="object.email or ''"> | 
				
			||||
 | 
					                                                                    mark.brown23@example.com | 
				
			||||
 | 
					                                                                </a> | 
				
			||||
 | 
					                                                            </b> | 
				
			||||
 | 
					                                                            <br/> | 
				
			||||
 | 
					                                                            And click on the | 
				
			||||
 | 
					                                                            button below to pick | 
				
			||||
 | 
					                                                            a password and | 
				
			||||
 | 
					                                                            activate your | 
				
			||||
 | 
					                                                            account. | 
				
			||||
 | 
					                                                            <br/> | 
				
			||||
 | 
					                                                            <br/> | 
				
			||||
 | 
					                                                            <center> | 
				
			||||
 | 
					                                                                <div style="margin: 16px 0px 16px 0px;align:center"> | 
				
			||||
 | 
					                                                                    <a t-att-href="object.signup_url" | 
				
			||||
 | 
					                                                                       style="background-color: #875A7B; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px; font-size:13px;"> | 
				
			||||
 | 
					                                                                        Login | 
				
			||||
 | 
					                                                                    </a> | 
				
			||||
 | 
					                                                                </div> | 
				
			||||
 | 
					                                                            </center> | 
				
			||||
 | 
					                                                            <br/> | 
				
			||||
 | 
					                                                            <br/> | 
				
			||||
 | 
					                                                            Enjoy Odoo! | 
				
			||||
 | 
					                                                            <br/> | 
				
			||||
 | 
					                                                            --<br/>The <t | 
				
			||||
 | 
					                                                                t-out="object.company_id.name or ''"> | 
				
			||||
 | 
					                                                            YourCompany | 
				
			||||
 | 
					                                                        </t> Team | 
				
			||||
 | 
					                                                        </div> | 
				
			||||
 | 
					                                                    </td> | 
				
			||||
 | 
					                                                </tr> | 
				
			||||
 | 
					                                            </t> | 
				
			||||
 | 
					                                            <t t-else=""> | 
				
			||||
 | 
					                                                <tr> | 
				
			||||
 | 
					                                                    <td valign="top" | 
				
			||||
 | 
					                                                        style="font-size: 13px;"> | 
				
			||||
 | 
					                                                        <div> | 
				
			||||
 | 
					                                                            Dear <t | 
				
			||||
 | 
					                                                                t-out="object.name or ''"> | 
				
			||||
 | 
					                                                            Marc Demo</t>, | 
				
			||||
 | 
					                                                            <br/> | 
				
			||||
 | 
					                                                            <br/> | 
				
			||||
 | 
					                                                            You have been | 
				
			||||
 | 
					                                                            invited by <t | 
				
			||||
 | 
					                                                                t-out="object.create_uid.name or ''"> | 
				
			||||
 | 
					                                                            OdooBot | 
				
			||||
 | 
					                                                        </t> of <t | 
				
			||||
 | 
					                                                                t-out="object.company_id.name or ''"> | 
				
			||||
 | 
					                                                            YourCompany | 
				
			||||
 | 
					                                                        </t> to connect on Odoo. | 
				
			||||
 | 
					                                                            <div style="margin: 16px 0px 16px 0px;"> | 
				
			||||
 | 
					                                                                <a t-att-href="object.signup_url" | 
				
			||||
 | 
					                                                                   style="background-color: #875A7B; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px; font-size:13px;"> | 
				
			||||
 | 
					                                                                    Accept | 
				
			||||
 | 
					                                                                    invitation | 
				
			||||
 | 
					                                                                </a> | 
				
			||||
 | 
					                                                            </div> | 
				
			||||
 | 
					                                                            <t t-set="website_url" | 
				
			||||
 | 
					                                                               t-value="object.get_base_url()"> | 
				
			||||
 | 
					                                                            </t> | 
				
			||||
 | 
					                                                            Your Odoo domain is: | 
				
			||||
 | 
					                                                            <b> | 
				
			||||
 | 
					                                                                <a t-att-href='website_url' | 
				
			||||
 | 
					                                                                   t-out="website_url or ''"> | 
				
			||||
 | 
					                                                                    http://yourcompany.odoo.com | 
				
			||||
 | 
					                                                                </a> | 
				
			||||
 | 
					                                                            </b> | 
				
			||||
 | 
					                                                            <br/> | 
				
			||||
 | 
					                                                            Your sign in email | 
				
			||||
 | 
					                                                            is: | 
				
			||||
 | 
					                                                            <b> | 
				
			||||
 | 
					                                                                <a t-attf-href="/web/login?login={{ object.email }}" | 
				
			||||
 | 
					                                                                   target="_blank" | 
				
			||||
 | 
					                                                                   t-out="object.email or ''"> | 
				
			||||
 | 
					                                                                    mark.brown23@example.com | 
				
			||||
 | 
					                                                                </a> | 
				
			||||
 | 
					                                                            </b> | 
				
			||||
 | 
					                                                            <br/> | 
				
			||||
 | 
					                                                            <br/> | 
				
			||||
 | 
					                                                            Never heard of Odoo? | 
				
			||||
 | 
					                                                            It’s an all-in-one | 
				
			||||
 | 
					                                                            business software | 
				
			||||
 | 
					                                                            loved by 7+ million | 
				
			||||
 | 
					                                                            users. It will | 
				
			||||
 | 
					                                                            considerably improve | 
				
			||||
 | 
					                                                            your experience at | 
				
			||||
 | 
					                                                            work and increase | 
				
			||||
 | 
					                                                            your productivity. | 
				
			||||
 | 
					                                                            <br/> | 
				
			||||
 | 
					                                                            <br/> | 
				
			||||
 | 
					                                                            Have a look at the <a | 
				
			||||
 | 
					                                                                href="https://www.odoo.com/page/tour?utm_source=db&utm_medium=auth" | 
				
			||||
 | 
					                                                                style="color: #875A7B;"> | 
				
			||||
 | 
					                                                            Odoo Tour | 
				
			||||
 | 
					                                                        </a> to discover the | 
				
			||||
 | 
					                                                            tool. | 
				
			||||
 | 
					                                                            <br/> | 
				
			||||
 | 
					                                                            <br/> | 
				
			||||
 | 
					                                                            Enjoy Odoo! | 
				
			||||
 | 
					                                                            <br/> | 
				
			||||
 | 
					                                                            --<br/>The <t | 
				
			||||
 | 
					                                                                t-out="object.company_id.name or ''"> | 
				
			||||
 | 
					                                                            YourCompany | 
				
			||||
 | 
					                                                        </t> Team | 
				
			||||
 | 
					                                                        </div> | 
				
			||||
 | 
					                                                    </td> | 
				
			||||
 | 
					                                                </tr> | 
				
			||||
 | 
					                                            </t> | 
				
			||||
 | 
					                                            <tr> | 
				
			||||
 | 
					                                                <td style="text-align:center;"> | 
				
			||||
 | 
					                                                    <hr width="100%" | 
				
			||||
 | 
					                                                        style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"/> | 
				
			||||
 | 
					                                                </td> | 
				
			||||
 | 
					                                            </tr> | 
				
			||||
 | 
					                                        </table> | 
				
			||||
 | 
					                                    </td> | 
				
			||||
 | 
					                                </tr> | 
				
			||||
 | 
					                                <!-- FOOTER --> | 
				
			||||
 | 
					                                <tr> | 
				
			||||
 | 
					                                    <td align="center" | 
				
			||||
 | 
					                                        style="min-width: 590px;"> | 
				
			||||
 | 
					                                        <table border="0" cellpadding="0" | 
				
			||||
 | 
					                                               cellspacing="0" width="590" | 
				
			||||
 | 
					                                               style="min-width: 590px; background-color: white; font-size: 11px; padding: 0px 8px 0px 8px; border-collapse:separate;"> | 
				
			||||
 | 
					                                            <tr> | 
				
			||||
 | 
					                                                <td valign="middle" | 
				
			||||
 | 
					                                                    align="left"> | 
				
			||||
 | 
					                                                    <t t-out="object.company_id.name or ''"> | 
				
			||||
 | 
					                                                        YourCompany | 
				
			||||
 | 
					                                                    </t> | 
				
			||||
 | 
					                                                </td> | 
				
			||||
 | 
					                                            </tr> | 
				
			||||
 | 
					                                            <tr> | 
				
			||||
 | 
					                                                <td valign="middle" align="left" | 
				
			||||
 | 
					                                                    style="opacity: 0.7;"> | 
				
			||||
 | 
					                                                    <t t-out="object.company_id.phone or ''"> | 
				
			||||
 | 
					                                                        +1 650-123-4567 | 
				
			||||
 | 
					                                                    </t> | 
				
			||||
 | 
					                                                    <t t-if="object.company_id.email"> | 
				
			||||
 | 
					                                                        | | 
				
			||||
 | 
					                                                        <a t-att-href="'mailto:%s' % object.company_id.email" | 
				
			||||
 | 
					                                                           style="text-decoration:none; color: #454748;" | 
				
			||||
 | 
					                                                           t-out="object.company_id.email or ''"> | 
				
			||||
 | 
					                                                            info@yourcompany.com | 
				
			||||
 | 
					                                                        </a> | 
				
			||||
 | 
					                                                    </t> | 
				
			||||
 | 
					                                                    <t t-if="object.company_id.website"> | 
				
			||||
 | 
					                                                        | | 
				
			||||
 | 
					                                                        <a t-att-href="'%s' % object.company_id.website" | 
				
			||||
 | 
					                                                           style="text-decoration:none; color: #454748;" | 
				
			||||
 | 
					                                                           t-out="object.company_id.website or ''"> | 
				
			||||
 | 
					                                                            http://www.example.com | 
				
			||||
 | 
					                                                        </a> | 
				
			||||
 | 
					                                                    </t> | 
				
			||||
 | 
					                                                </td> | 
				
			||||
 | 
					                                            </tr> | 
				
			||||
 | 
					                                        </table> | 
				
			||||
 | 
					                                    </td> | 
				
			||||
 | 
					                                </tr> | 
				
			||||
 | 
					                            </tbody> | 
				
			||||
 | 
					                        </table> | 
				
			||||
 | 
					                    </td> | 
				
			||||
 | 
					                </tr> | 
				
			||||
 | 
					                <!-- POWERED BY --> | 
				
			||||
 | 
					                <tr> | 
				
			||||
 | 
					                    <td align="center" style="min-width: 590px;"> | 
				
			||||
 | 
					                        <table border="0" cellpadding="0" cellspacing="0" | 
				
			||||
 | 
					                               width="590" | 
				
			||||
 | 
					                               style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;"> | 
				
			||||
 | 
					                            <tr> | 
				
			||||
 | 
					                                <td style="text-align: center; font-size: 13px;"> | 
				
			||||
 | 
					                                    Powered by | 
				
			||||
 | 
					                                    <a target="_blank" | 
				
			||||
 | 
					                                       href="https://www.odoo.com?utm_source=db&utm_medium=auth" | 
				
			||||
 | 
					                                       style="color: #875A7B;">Odoo | 
				
			||||
 | 
					                                    </a> | 
				
			||||
 | 
					                                </td> | 
				
			||||
 | 
					                            </tr> | 
				
			||||
 | 
					                        </table> | 
				
			||||
 | 
					                    </td> | 
				
			||||
 | 
					                </tr> | 
				
			||||
 | 
					            </table> | 
				
			||||
 | 
					        </field> | 
				
			||||
 | 
					        <field name="lang">{{ object.lang }}</field> | 
				
			||||
 | 
					        <field name="auto_delete" eval="True"/> | 
				
			||||
 | 
					    </record> | 
				
			||||
 | 
					    <function name="write" model="ir.model.data"> | 
				
			||||
 | 
					        <function name="search" model="ir.model.data"> | 
				
			||||
 | 
					            <value eval="[('name', '=', 'set_password_email'), ('module', '=', 'auth_signup')]"/> | 
				
			||||
 | 
					        </function> | 
				
			||||
 | 
					        <value eval="{'noupdate': True}"/> | 
				
			||||
 | 
					    </function> | 
				
			||||
 | 
					</odoo> | 
				
			||||
@ -0,0 +1,12 @@ | 
				
			|||||
 | 
					<?xml version="1.0" encoding="UTF-8" ?> | 
				
			||||
 | 
					<odoo> | 
				
			||||
 | 
					    <!-- This file is used for new website menu for online admission --> | 
				
			||||
 | 
					    <data noupdate="1"> | 
				
			||||
 | 
					        <record id="apply_online_menu" model="website.menu"> | 
				
			||||
 | 
					            <field name="name">University</field> | 
				
			||||
 | 
					            <field name="url">/university</field> | 
				
			||||
 | 
					            <field name="parent_id" ref="website.main_menu"/> | 
				
			||||
 | 
					            <field name="sequence" type="int">80</field> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					    </data> | 
				
			||||
 | 
					</odoo> | 
				
			||||
@ -0,0 +1,202 @@ | 
				
			|||||
 | 
					<?xml version="1.0" encoding="utf-8"?> | 
				
			||||
 | 
					<odoo> | 
				
			||||
 | 
					    <data> | 
				
			||||
 | 
					        <!--Academic Year data--> | 
				
			||||
 | 
					        <record id="university_academic_year_data" | 
				
			||||
 | 
					                model="university.academic.year"> | 
				
			||||
 | 
					            <field name="name">2022-2023</field> | 
				
			||||
 | 
					            <field name="start_date">2022-06-01</field> | 
				
			||||
 | 
					            <field name="end_date">2023-04-01</field> | 
				
			||||
 | 
					            <field name="is_active">1</field> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!--Document type data 1--> | 
				
			||||
 | 
					        <record id="document_type_data" model="university.document.type"> | 
				
			||||
 | 
					            <field name="name">TC</field> | 
				
			||||
 | 
					            <field name="description">Transfer Certificate</field> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!--Document type data 2--> | 
				
			||||
 | 
					        <record id="document_type_data2" model="university.document.type"> | 
				
			||||
 | 
					            <field name="name">Birth Certificate</field> | 
				
			||||
 | 
					            <field name="description">Birth Certificate of the student</field> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!--Reject reason data--> | 
				
			||||
 | 
					        <record id="reject_reason_data" model="reject.reason"> | 
				
			||||
 | 
					            <field name="name">Low Marks</field> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!--University Course demo data 1--> | 
				
			||||
 | 
					        <record id="university_course_data1" model="university.course"> | 
				
			||||
 | 
					            <field name="name">Degree</field> | 
				
			||||
 | 
					            <field name="category">ug</field> | 
				
			||||
 | 
					            <field name="no_semester">6</field> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!--University Course demo data 2--> | 
				
			||||
 | 
					        <record id="university_course_data2" model="university.course"> | 
				
			||||
 | 
					            <field name="name">BTech</field> | 
				
			||||
 | 
					            <field name="category">ug</field> | 
				
			||||
 | 
					            <field name="no_semester">8</field> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!--University Department demo data 1--> | 
				
			||||
 | 
					        <record id="university_department_data1" model="university.department"> | 
				
			||||
 | 
					            <field name="name">Computer Science</field> | 
				
			||||
 | 
					            <field name="code">CSE</field> | 
				
			||||
 | 
					            <field name="course_id" ref="university_course_data2"/> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!--University Department demo data 2--> | 
				
			||||
 | 
					        <record id="university_department_data2" model="university.department"> | 
				
			||||
 | 
					            <field name="name">Economics</field> | 
				
			||||
 | 
					            <field name="code">BA.ECO</field> | 
				
			||||
 | 
					            <field name="course_id" ref="university_course_data1"/> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!--University Subjects demo data 1--> | 
				
			||||
 | 
					        <record id="university_subject_data1" model="university.subject"> | 
				
			||||
 | 
					            <field name="name">English</field> | 
				
			||||
 | 
					            <field name="code">ENG</field> | 
				
			||||
 | 
					            <field name="type">compulsory</field> | 
				
			||||
 | 
					            <field name="is_language">1</field> | 
				
			||||
 | 
					            <field name="weightage">3</field> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!--University Subjects demo data 2--> | 
				
			||||
 | 
					        <record id="university_subject_data2" model="university.subject"> | 
				
			||||
 | 
					            <field name="name">Basics of Python</field> | 
				
			||||
 | 
					            <field name="code">PYTHON</field> | 
				
			||||
 | 
					            <field name="type">compulsory</field> | 
				
			||||
 | 
					            <field name="weightage">4</field> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!--University Subjects demo data 3--> | 
				
			||||
 | 
					        <record id="university_subject_data3" model="university.subject"> | 
				
			||||
 | 
					            <field name="name">Physics</field> | 
				
			||||
 | 
					            <field name="code">PHY</field> | 
				
			||||
 | 
					            <field name="type">compulsory</field> | 
				
			||||
 | 
					            <field name="weightage">4</field> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!--University Subjects demo data 4--> | 
				
			||||
 | 
					        <record id="university_subject_data4" model="university.subject"> | 
				
			||||
 | 
					            <field name="name">Chemistry</field> | 
				
			||||
 | 
					            <field name="code">CHE</field> | 
				
			||||
 | 
					            <field name="type">compulsory</field> | 
				
			||||
 | 
					            <field name="weightage">4</field> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!--University Semester demo data 1--> | 
				
			||||
 | 
					        <record id="university_semester_data1" model="university.semester"> | 
				
			||||
 | 
					            <field name="semester_no">6</field> | 
				
			||||
 | 
					            <field name="department_id" ref="university_department_data1"/> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!--University Batch demo data--> | 
				
			||||
 | 
					        <record id="university_batch_data" model="university.batch"> | 
				
			||||
 | 
					            <field name="semester_id" ref="university_semester_data1"/> | 
				
			||||
 | 
					            <field name="academic_year_id" | 
				
			||||
 | 
					                   ref="university_academic_year_data"/> | 
				
			||||
 | 
					            <field name="batch_strength">30</field> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!--University Timetable Period demo data 1--> | 
				
			||||
 | 
					        <record id="timetable_period_data1" model="timetable.period"> | 
				
			||||
 | 
					            <field name="name">Period 1</field> | 
				
			||||
 | 
					            <field name="time_from">10.00</field> | 
				
			||||
 | 
					            <field name="time_to">11.00</field> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!--University Timetable Period demo data 2--> | 
				
			||||
 | 
					        <record id="timetable_period_data2" model="timetable.period"> | 
				
			||||
 | 
					            <field name="name">Period 2</field> | 
				
			||||
 | 
					            <field name="time_from">11.00</field> | 
				
			||||
 | 
					            <field name="time_to">12.00</field> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!--University Faculty demo data 1--> | 
				
			||||
 | 
					        <record id="university_faculty_data1" model="university.faculty"> | 
				
			||||
 | 
					            <field name="name">John</field> | 
				
			||||
 | 
					            <field name="last_name">Aryan</field> | 
				
			||||
 | 
					            <field name="date_of_birth">1993-02-25</field> | 
				
			||||
 | 
					            <field name="email">johnaryan@gmail.com</field> | 
				
			||||
 | 
					            <field name="mobile">+916745397801</field> | 
				
			||||
 | 
					            <field name="image" type="base64" | 
				
			||||
 | 
					                   file="education_university_management/static/src/img/faculty1.jpeg"/> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!--University Faculty demo data 2--> | 
				
			||||
 | 
					        <record id="university_faculty_data2" model="university.faculty"> | 
				
			||||
 | 
					            <field name="name">Adams</field> | 
				
			||||
 | 
					            <field name="last_name">O</field> | 
				
			||||
 | 
					            <field name="date_of_birth">1993-02-25</field> | 
				
			||||
 | 
					            <field name="email">adams@gmail.com</field> | 
				
			||||
 | 
					            <field name="mobile">+919967934500</field> | 
				
			||||
 | 
					            <field name="image" type="base64" | 
				
			||||
 | 
					                   file="education_university_management/static/src/img/faculty2.png"/> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!--       Exam type demo data1 --> | 
				
			||||
 | 
					        <record id="university_exam_type_data1" model="university.exam.type"> | 
				
			||||
 | 
					            <field name="name">First Internal</field> | 
				
			||||
 | 
					            <field name="exam_type">internal</field> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!--       Exam type demo data2 --> | 
				
			||||
 | 
					        <record id="university_exam_type_data2" model="university.exam.type"> | 
				
			||||
 | 
					            <field name="name">First Semester</field> | 
				
			||||
 | 
					            <field name="exam_type">sem</field> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!-- University parent data1--> | 
				
			||||
 | 
					        <record id="university_parent_data1" model="res.partner"> | 
				
			||||
 | 
					            <field name="name">Daniel George</field> | 
				
			||||
 | 
					            <field name="email">daniel@gmail.com</field> | 
				
			||||
 | 
					            <field name="is_parent" eval="True"/> | 
				
			||||
 | 
					            <field name="city">Banglore</field> | 
				
			||||
 | 
					            <field name="zip">530068</field> | 
				
			||||
 | 
					            <field name="country_id" ref="base.in"/> | 
				
			||||
 | 
					            <field name="street">560003 Majestic</field> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!-- University parent data2--> | 
				
			||||
 | 
					        <record id="university_parent_data2" model="res.partner"> | 
				
			||||
 | 
					            <field name="name">Joseph Alex</field> | 
				
			||||
 | 
					            <field name="email">joseph@cybrosys.com</field> | 
				
			||||
 | 
					            <field name="is_parent" eval="True"/> | 
				
			||||
 | 
					            <field name="city">Calicut</field> | 
				
			||||
 | 
					            <field name="zip">670645</field> | 
				
			||||
 | 
					            <field name="country_id" ref="base.in"/> | 
				
			||||
 | 
					            <field name="street">670645 Calicut</field> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!--Student Application demo data1 --> | 
				
			||||
 | 
					        <record id="student_application_data" model="university.application"> | 
				
			||||
 | 
					            <field name="name">John</field> | 
				
			||||
 | 
					            <field name="middle_name">Daniel</field> | 
				
			||||
 | 
					            <field name="last_name">Smith</field> | 
				
			||||
 | 
					            <field name="admission_date">2018-06-06 00:00:00</field> | 
				
			||||
 | 
					            <field name="course_id" ref="university_course_data1"/> | 
				
			||||
 | 
					            <field name="department_id" ref="university_department_data1"/> | 
				
			||||
 | 
					            <field name="semester_id" ref="university_semester_data1"/> | 
				
			||||
 | 
					            <field name="batch_id" ref="university_batch_data"/> | 
				
			||||
 | 
					            <field name="academic_year_id" | 
				
			||||
 | 
					                   ref="university_academic_year_data"/> | 
				
			||||
 | 
					            <field name="father_name">Daniel George</field> | 
				
			||||
 | 
					            <field name="mother_name">Lissa Abraham</field> | 
				
			||||
 | 
					            <field name="guardian_id" ref="university_parent_data1"/> | 
				
			||||
 | 
					            <field name="date_of_birth">1994-11-11</field> | 
				
			||||
 | 
					            <field name="gender">male</field> | 
				
			||||
 | 
					            <field name="blood_group">a+</field> | 
				
			||||
 | 
					            <field name="street">Banglore</field> | 
				
			||||
 | 
					            <field name="is_same_address">1</field> | 
				
			||||
 | 
					            <field name="mobile">9998889988</field> | 
				
			||||
 | 
					            <field name="email">danielsmith@gmail.com</field> | 
				
			||||
 | 
					            <field name="image" type="base64" | 
				
			||||
 | 
					                   file="education_university_management/static/src/img/student1.jpeg"/> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					        <!--Student Application demo data2 --> | 
				
			||||
 | 
					        <record id="student_application_data2" model="university.application"> | 
				
			||||
 | 
					            <field name="name">Alana</field> | 
				
			||||
 | 
					            <field name="last_name">Joseph</field> | 
				
			||||
 | 
					            <field name="admission_date">2018-06-06 00:00:00</field> | 
				
			||||
 | 
					            <field name="course_id" ref="university_course_data1"/> | 
				
			||||
 | 
					            <field name="department_id" ref="university_department_data1"/> | 
				
			||||
 | 
					            <field name="semester_id" ref="university_semester_data1"/> | 
				
			||||
 | 
					            <field name="academic_year_id" | 
				
			||||
 | 
					                   ref="university_academic_year_data"/> | 
				
			||||
 | 
					            <field name="father_name">Joseph Alex</field> | 
				
			||||
 | 
					            <field name="mother_name">Smitha</field> | 
				
			||||
 | 
					            <field name="guardian_id" ref="university_parent_data2"/> | 
				
			||||
 | 
					            <field name="date_of_birth">1994-11-11</field> | 
				
			||||
 | 
					            <field name="gender">female</field> | 
				
			||||
 | 
					            <field name="blood_group">o+</field> | 
				
			||||
 | 
					            <field name="street">Kochi</field> | 
				
			||||
 | 
					            <field name="is_same_address">1</field> | 
				
			||||
 | 
					            <field name="mobile">8936458900</field> | 
				
			||||
 | 
					            <field name="email">alana@gmail.com</field> | 
				
			||||
 | 
					            <field name="image" type="base64" | 
				
			||||
 | 
					                   file="education_university_management/static/src/img/student2.jpeg"/> | 
				
			||||
 | 
					        </record> | 
				
			||||
 | 
					    </data> | 
				
			||||
 | 
					</odoo> | 
				
			||||
@ -0,0 +1,6 @@ | 
				
			|||||
 | 
					## Module <education_university_management> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					#### 06.01.2024 | 
				
			||||
 | 
					#### Version 16.0.1.0.0 | 
				
			||||
 | 
					#### ADD | 
				
			||||
 | 
					Initial Commit  University Education Management | 
				
			||||
@ -0,0 +1,53 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from . import account_journal | 
				
			||||
 | 
					from . import account_move | 
				
			||||
 | 
					from . import exam_result | 
				
			||||
 | 
					from . import exam_subject_line | 
				
			||||
 | 
					from . import exam_valuation | 
				
			||||
 | 
					from . import exam_valuation_line | 
				
			||||
 | 
					from . import fee_category | 
				
			||||
 | 
					from . import fee_structure | 
				
			||||
 | 
					from . import fee_structure_line | 
				
			||||
 | 
					from . import fee_type | 
				
			||||
 | 
					from . import reject_reason | 
				
			||||
 | 
					from . import res_partner | 
				
			||||
 | 
					from . import results_subject_line | 
				
			||||
 | 
					from . import timetable_period | 
				
			||||
 | 
					from . import timetable_schedule_line | 
				
			||||
 | 
					from . import university_academic_year | 
				
			||||
 | 
					from . import university_application | 
				
			||||
 | 
					from . import university_attendance | 
				
			||||
 | 
					from . import university_attendance_line | 
				
			||||
 | 
					from . import university_batch | 
				
			||||
 | 
					from . import university_course | 
				
			||||
 | 
					from . import university_department | 
				
			||||
 | 
					from . import university_document | 
				
			||||
 | 
					from . import university_document_type | 
				
			||||
 | 
					from . import university_exam | 
				
			||||
 | 
					from . import university_exam_type | 
				
			||||
 | 
					from . import university_faculty | 
				
			||||
 | 
					from . import university_semester | 
				
			||||
 | 
					from . import university_student | 
				
			||||
 | 
					from . import university_subject | 
				
			||||
 | 
					from . import university_syllabus | 
				
			||||
 | 
					from . import university_timetable | 
				
			||||
@ -0,0 +1,32 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class AccountJournal(models.Model): | 
				
			||||
 | 
					    """Inherited account.journal model for adding a field to | 
				
			||||
 | 
					                        determine the journal is fee journal or not""" | 
				
			||||
 | 
					    _inherit = 'account.journal' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    is_fee = fields.Boolean('Is University fee?', default=False, | 
				
			||||
 | 
					                            help="Enable if the journal for university " | 
				
			||||
 | 
					                                 "fee management") | 
				
			||||
@ -0,0 +1,114 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import api, fields, models, _ | 
				
			||||
 | 
					from odoo.exceptions import ValidationError | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class AccountMove(models.Model): | 
				
			||||
 | 
					    """Inheriting account move model for creating receipt for students fees""" | 
				
			||||
 | 
					    _inherit = 'account.move' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    student_id = fields.Many2one('university.student', | 
				
			||||
 | 
					                                 string='Admission No', | 
				
			||||
 | 
					                                 help="Select student for creating fee " | 
				
			||||
 | 
					                                      "receipt") | 
				
			||||
 | 
					    student_name = fields.Char(string='Name', | 
				
			||||
 | 
					                               help="Student name that your going to " | 
				
			||||
 | 
					                                    "make receipt", store=True, | 
				
			||||
 | 
					                               related='student_id.partner_id.name') | 
				
			||||
 | 
					    semester_id = fields.Many2one(related='student_id.semester_id', | 
				
			||||
 | 
					                                  help="Semester of the student", | 
				
			||||
 | 
					                                  string='Semester') | 
				
			||||
 | 
					    batch_id = fields.Many2one(related='student_id.batch_id', | 
				
			||||
 | 
					                               help="batch of the student", ) | 
				
			||||
 | 
					    fee_structure_id = fields.Many2one('fee.structure', | 
				
			||||
 | 
					                                       help="Select a fee structure", | 
				
			||||
 | 
					                                       string='Fee Structure') | 
				
			||||
 | 
					    fee_structure_ids = fields.Many2many('fee.structure', | 
				
			||||
 | 
					                                         string="Fee Structure", | 
				
			||||
 | 
					                                         compute="_compute_fee_structure_ids", | 
				
			||||
 | 
					                                         help="Select a fee structure", ) | 
				
			||||
 | 
					    is_fee = fields.Boolean(string='Is Fee', store=True, default=False, | 
				
			||||
 | 
					                            help="To determine whether the account " | 
				
			||||
 | 
					                                 "move is for fee or not") | 
				
			||||
 | 
					    fee_category_id = fields.Many2one('fee.category', | 
				
			||||
 | 
					                                      help="Select a fee category", | 
				
			||||
 | 
					                                      string='Category') | 
				
			||||
 | 
					    partner_id = fields.Many2one(related='student_id.partner_id', | 
				
			||||
 | 
					                                 help="Set student partner in customer", ) | 
				
			||||
 | 
					    journal_id = fields.Many2one(related='fee_category_id.journal_id', | 
				
			||||
 | 
					                                 help="Journal of the receipt") | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @api.model | 
				
			||||
 | 
					    def create(self, vals): | 
				
			||||
 | 
					        """ This method overrides the create method to add two fields to the | 
				
			||||
 | 
					            invoice: 'is_fee' and 'student_name'.The 'is_fee' field is used to | 
				
			||||
 | 
					            display fee items only in the fee tree view. | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					            :param vals (dict): Dictionary containing the field values for the | 
				
			||||
 | 
					                                new invoice record. | 
				
			||||
 | 
					            :returns class:`~account.move`: The created invoice record. | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        partner = self.env['res.partner'].browse(vals.get('partner_id')) | 
				
			||||
 | 
					        if vals.get('fee_category_id'): | 
				
			||||
 | 
					            vals.update({ | 
				
			||||
 | 
					                'is_fee': True, | 
				
			||||
 | 
					                'student_name': partner.name | 
				
			||||
 | 
					            }) | 
				
			||||
 | 
					        res = super(AccountMove, self).create(vals) | 
				
			||||
 | 
					        return res | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @api.onchange('fee_structure_id') | 
				
			||||
 | 
					    def _onchange_fee_structure_id(self): | 
				
			||||
 | 
					        """Set default fee lines based on selected fee structure""" | 
				
			||||
 | 
					        lines = [] | 
				
			||||
 | 
					        self.invoice_line_ids = False | 
				
			||||
 | 
					        for item in self: | 
				
			||||
 | 
					            for line in item.fee_structure_id.structure_line_ids: | 
				
			||||
 | 
					                name = line.fee_type_id.product_id.description_sale | 
				
			||||
 | 
					                if not name: | 
				
			||||
 | 
					                    name = line.fee_type_id.product_id.name | 
				
			||||
 | 
					                fee_line = { | 
				
			||||
 | 
					                    'price_unit': line.fee_amount, | 
				
			||||
 | 
					                    'quantity': 1.00, | 
				
			||||
 | 
					                    'product_id': line.fee_type_id.product_id, | 
				
			||||
 | 
					                    'name': name, | 
				
			||||
 | 
					                    'account_id': item.journal_id.default_account_id | 
				
			||||
 | 
					                } | 
				
			||||
 | 
					                lines.append((0, 0, fee_line)) | 
				
			||||
 | 
					            item.invoice_line_ids = lines | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @api.depends('fee_category_id') | 
				
			||||
 | 
					    def _compute_fee_structure_ids(self): | 
				
			||||
 | 
					        """ To find the fee structure in the selected category and assign them | 
				
			||||
 | 
					            to fee_structure_ids field for setting domain for | 
				
			||||
 | 
					            fee_category_id field """ | 
				
			||||
 | 
					        for rec in self: | 
				
			||||
 | 
					            if rec.fee_category_id: | 
				
			||||
 | 
					                rec.fee_structure_ids = self.env['fee.structure'].search( | 
				
			||||
 | 
					                    [('category_id', '=', rec.fee_category_id.id)]).ids | 
				
			||||
 | 
					                if not rec.fee_structure_ids: | 
				
			||||
 | 
					                    raise ValidationError( | 
				
			||||
 | 
					                        _("No Fee Structure found for selected Category, " | 
				
			||||
 | 
					                          "Please choose another one")) | 
				
			||||
 | 
					            else: | 
				
			||||
 | 
					                rec.fee_structure_ids = False | 
				
			||||
@ -0,0 +1,83 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import api, fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class ExamResult(models.Model): | 
				
			||||
 | 
					    """Creating a model for storing students exam result.""" | 
				
			||||
 | 
					    _name = 'exam.result' | 
				
			||||
 | 
					    _inherit = ['mail.thread', 'mail.activity.mixin'] | 
				
			||||
 | 
					    _description = "Exam Result" | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    name = fields.Char(string='Name', help="Name of the exam result") | 
				
			||||
 | 
					    exam_id = fields.Many2one('university.exam', string='Exam', | 
				
			||||
 | 
					                              help="Which exam does this result belong to") | 
				
			||||
 | 
					    batch_id = fields.Many2one('university.batch', string='Batch', | 
				
			||||
 | 
					                               help="Which batch does this result belong to") | 
				
			||||
 | 
					    student_id = fields.Many2one('university.student', | 
				
			||||
 | 
					                                 string='Student', help="Result of student") | 
				
			||||
 | 
					    subject_line_ids = fields.One2many('results.subject.line', | 
				
			||||
 | 
					                                       'result_id', | 
				
			||||
 | 
					                                       help="Result of each subject in exam", | 
				
			||||
 | 
					                                       string='Subjects') | 
				
			||||
 | 
					    academic_year_id = fields.Many2one(related='batch_id.academic_year_id', | 
				
			||||
 | 
					                                       help="Academic year of the batch", | 
				
			||||
 | 
					                                       string='Academic Year') | 
				
			||||
 | 
					    company_id = fields.Many2one( | 
				
			||||
 | 
					        'res.company', string='Company', help="Which company's " | 
				
			||||
 | 
					                                              "result is", | 
				
			||||
 | 
					        default=lambda self: self.env.company) | 
				
			||||
 | 
					    total_pass_mark = fields.Float(string='Total Pass Mark', store=True, | 
				
			||||
 | 
					                                   help="Total mark to pass the exam", | 
				
			||||
 | 
					                                   readonly=True, compute='_total_marks_all') | 
				
			||||
 | 
					    total_max_mark = fields.Float(string='Total Max Mark', store=True, | 
				
			||||
 | 
					                                  help="Maximum mark of the exam", | 
				
			||||
 | 
					                                  readonly=True, | 
				
			||||
 | 
					                                  compute='_compute_total_marks') | 
				
			||||
 | 
					    total_mark_scored = fields.Float(string='Total Marks Scored', store=True, | 
				
			||||
 | 
					                                     help="Total mark scored by student", | 
				
			||||
 | 
					                                     readonly=True, | 
				
			||||
 | 
					                                     compute='_compute_total_marks') | 
				
			||||
 | 
					    is_overall_pass = fields.Boolean(string='Overall Pass/Fail', store=True, | 
				
			||||
 | 
					                                     help="Overall pass or fail ratio", | 
				
			||||
 | 
					                                     readonly=True, | 
				
			||||
 | 
					                                     compute='_compute_total_marks') | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @api.depends('subject_line_ids.mark_scored') | 
				
			||||
 | 
					    def _compute_total_marks(self): | 
				
			||||
 | 
					        """This method is for computing total mark scored and overall | 
				
			||||
 | 
					                    pass details""" | 
				
			||||
 | 
					        for results in self: | 
				
			||||
 | 
					            total_pass_mark = 0 | 
				
			||||
 | 
					            total_max_mark = 0 | 
				
			||||
 | 
					            total_mark_scored = 0 | 
				
			||||
 | 
					            is_overall_pass = True | 
				
			||||
 | 
					            for subjects in results.subject_line_ids: | 
				
			||||
 | 
					                total_pass_mark += subjects.pass_mark | 
				
			||||
 | 
					                total_max_mark += subjects.max_mark | 
				
			||||
 | 
					                total_mark_scored += subjects.mark_scored | 
				
			||||
 | 
					                if not subjects.is_pass: | 
				
			||||
 | 
					                    is_overall_pass = False | 
				
			||||
 | 
					            results.total_pass_mark = total_pass_mark | 
				
			||||
 | 
					            results.total_max_mark = total_max_mark | 
				
			||||
 | 
					            results.total_mark_scored = total_mark_scored | 
				
			||||
 | 
					            results.is_overall_pass = is_overall_pass | 
				
			||||
@ -0,0 +1,44 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class ExamSubjectLine(models.Model): | 
				
			||||
 | 
					    """For managing the subjects in the exam""" | 
				
			||||
 | 
					    _name = 'exam.subject.line' | 
				
			||||
 | 
					    _description = 'Subject Line of Exam' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    subject_id = fields.Many2one('university.subject', | 
				
			||||
 | 
					                                 string='Subject', required=True, | 
				
			||||
 | 
					                                 help="Select subjects of exam") | 
				
			||||
 | 
					    date = fields.Date(string='Date', required=True, | 
				
			||||
 | 
					                       help="Select date of the subject") | 
				
			||||
 | 
					    time_from = fields.Float(string='Time From', required=True, | 
				
			||||
 | 
					                             help="Enter starting time of the subject") | 
				
			||||
 | 
					    time_to = fields.Float(string='Time To', required=True, | 
				
			||||
 | 
					                           help="Enter ending time of the subject") | 
				
			||||
 | 
					    mark = fields.Integer(string='Mark', help="Enter mark for the subject") | 
				
			||||
 | 
					    exam_id = fields.Many2one('university.exam', string='Exam', | 
				
			||||
 | 
					                              help="Relation to exam model") | 
				
			||||
 | 
					    company_id = fields.Many2one( | 
				
			||||
 | 
					        'res.company', string='Company', help="Company of the exam", | 
				
			||||
 | 
					        default=lambda self: self.env.company) | 
				
			||||
@ -0,0 +1,183 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import api, fields, models, _ | 
				
			||||
 | 
					from odoo.exceptions import UserError | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class ExamValuation(models.Model): | 
				
			||||
 | 
					    """Used to manage the valuation of exams""" | 
				
			||||
 | 
					    _name = 'exam.valuation' | 
				
			||||
 | 
					    _description = "Exam Valuation" | 
				
			||||
 | 
					    _inherit = ['mail.thread', 'mail.activity.mixin'] | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    name = fields.Char(string='Name', default='New', help="Name of the record") | 
				
			||||
 | 
					    exam_id = fields.Many2one('university.exam', string='Exam', | 
				
			||||
 | 
					                              required=True, help="Select exam for valuation", | 
				
			||||
 | 
					                              domain=[('state', '=', 'ongoing')]) | 
				
			||||
 | 
					    batch_id = fields.Many2one(related='exam_id.batch_id', string='Batch', | 
				
			||||
 | 
					                               help="Choose the batch that you want to" | 
				
			||||
 | 
					                                    " evaluate", required=True) | 
				
			||||
 | 
					    evaluator_id = fields.Many2one('university.faculty', | 
				
			||||
 | 
					                                   string='Evaluator', | 
				
			||||
 | 
					                                   help="Select a valuation evaluator") | 
				
			||||
 | 
					    mark = fields.Float(string='Max Mark', | 
				
			||||
 | 
					                        help="Maximum mark of the selected subject", | 
				
			||||
 | 
					                        required=True) | 
				
			||||
 | 
					    pass_mark = fields.Float(string='Pass Mark', | 
				
			||||
 | 
					                             help="Mark needed to pass the exam ", | 
				
			||||
 | 
					                             required=True) | 
				
			||||
 | 
					    state = fields.Selection([('draft', 'Draft'), | 
				
			||||
 | 
					                              ('completed', 'Completed'), | 
				
			||||
 | 
					                              ('cancel', 'Canceled')], default='draft', | 
				
			||||
 | 
					                             help="Status of the valuation") | 
				
			||||
 | 
					    valuation_line_ids = fields.One2many('exam.valuation.line', | 
				
			||||
 | 
					                                         'valuation_id', | 
				
			||||
 | 
					                                         help="Students valuation details", | 
				
			||||
 | 
					                                         string='Students') | 
				
			||||
 | 
					    subject_id = fields.Many2one('university.subject', | 
				
			||||
 | 
					                                 string='Subject', | 
				
			||||
 | 
					                                 help="Choose subject of the exam for " | 
				
			||||
 | 
					                                      "valuation", required=True) | 
				
			||||
 | 
					    subject_ids = fields.Many2many('university.subject', | 
				
			||||
 | 
					                                   string="Subjects", | 
				
			||||
 | 
					                                   help="Subjects under the exam", | 
				
			||||
 | 
					                                   compute="_compute_subject_ids") | 
				
			||||
 | 
					    is_mark_sheet_created = fields.Boolean(string='Mark sheet Created', | 
				
			||||
 | 
					                                           help="Enable if a mark sheet for " | 
				
			||||
 | 
					                                                "the students in the batch is " | 
				
			||||
 | 
					                                                "created or not") | 
				
			||||
 | 
					    date = fields.Date(string='Date', default=fields.Date.today, | 
				
			||||
 | 
					                       help="Date of the valuation") | 
				
			||||
 | 
					    academic_year_id = fields.Many2one(related='batch_id.academic_year_id', | 
				
			||||
 | 
					                                       string='Academic Year', | 
				
			||||
 | 
					                                       help="Academic year of the selected " | 
				
			||||
 | 
					                                            "batch") | 
				
			||||
 | 
					    company_id = fields.Many2one( | 
				
			||||
 | 
					        'res.company', string='Company', | 
				
			||||
 | 
					        help="Company of the valuation", default=lambda self: self.env.company) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def action_create_mark_sheet(self): | 
				
			||||
 | 
					        """Button action for creating marksheet of students""" | 
				
			||||
 | 
					        students = self.batch_id.batch_student_ids | 
				
			||||
 | 
					        if len(students) < 1: | 
				
			||||
 | 
					            raise UserError(_('There are no students in this Batch')) | 
				
			||||
 | 
					        self.env['exam.valuation.line'].create(({'student_id': student.id, | 
				
			||||
 | 
					                                                 'valuation_id': self.id, | 
				
			||||
 | 
					                                                 }) for student in students) | 
				
			||||
 | 
					        self.is_mark_sheet_created = True | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @api.model | 
				
			||||
 | 
					    def create(self, vals): | 
				
			||||
 | 
					        """ This method overrides the create method to check if the exam | 
				
			||||
 | 
					            valuation with respect to the subject and batch has already | 
				
			||||
 | 
					            been completed. | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					            :param vals (dict): Dictionary containing the field values for | 
				
			||||
 | 
					                                the new exam valuation record. | 
				
			||||
 | 
					            :returns class:`exam.valuation`The created exam valuation record. | 
				
			||||
 | 
					            :raises UserError: If a valuation sheet for the specified subject, | 
				
			||||
 | 
					                               division, and exam already exists. | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        res = super(ExamValuation, self).create(vals) | 
				
			||||
 | 
					        search_valuation = self.env['exam.valuation'].search( | 
				
			||||
 | 
					            [('exam_id', '=', res.exam_id.id), | 
				
			||||
 | 
					             ('batch_id', '=', res.batch_id.id), | 
				
			||||
 | 
					             ('subject_id', '=', res.subject_id.id), | 
				
			||||
 | 
					             ('state', '!=', 'cancel')]) | 
				
			||||
 | 
					        if len(search_valuation) > 1: | 
				
			||||
 | 
					            raise UserError( | 
				
			||||
 | 
					                _('Valuation Sheet for \n Subject --> %s \nDivision --> %s ' | 
				
			||||
 | 
					                  '\nExam --> %s \n is already created') % ( | 
				
			||||
 | 
					                    res.subject_id.name, res.batch_id.name, | 
				
			||||
 | 
					                    res.exam_id.name)) | 
				
			||||
 | 
					        return res | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @api.depends('exam_id') | 
				
			||||
 | 
					    def _compute_subject_ids(self): | 
				
			||||
 | 
					        """ To find the subjects in the selected exam and assign them | 
				
			||||
 | 
					            to subject_ids field for setting domain for subject_id field. | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        for rec in self: | 
				
			||||
 | 
					            rec.subject_ids = rec.exam_id.subject_line_ids.subject_id \ | 
				
			||||
 | 
					                if rec.exam_id else False | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def action_valuation_completed(self): | 
				
			||||
 | 
					        """Method for completing the valuation and also creating the exam | 
				
			||||
 | 
					          result with the valuation line and verify whether or not the exam | 
				
			||||
 | 
					          with the subject and the student already exists; if not, a new exam | 
				
			||||
 | 
					          result will be created.""" | 
				
			||||
 | 
					        self.name = str(self.exam_id.name) | 
				
			||||
 | 
					        result_obj = self.env['exam.result'] | 
				
			||||
 | 
					        result_line_obj = self.env['results.subject.line'] | 
				
			||||
 | 
					        for students in self.valuation_line_ids: | 
				
			||||
 | 
					            search_result = result_obj.search( | 
				
			||||
 | 
					                [('exam_id', '=', self.exam_id.id), | 
				
			||||
 | 
					                 ('batch_id', '=', self.batch_id.id), | 
				
			||||
 | 
					                 ('student_id', '=', students.student_id.id)]) | 
				
			||||
 | 
					            if len(search_result) < 1: | 
				
			||||
 | 
					                result_data = { | 
				
			||||
 | 
					                    'name': self.name, | 
				
			||||
 | 
					                    'exam_id': self.exam_id.id, | 
				
			||||
 | 
					                    'batch_id': self.batch_id.id, | 
				
			||||
 | 
					                    'student_id': students.student_id.id, | 
				
			||||
 | 
					                } | 
				
			||||
 | 
					                result = result_obj.create(result_data) | 
				
			||||
 | 
					                result_line_data = { | 
				
			||||
 | 
					                    'name': self.name, | 
				
			||||
 | 
					                    'subject_id': self.subject_id.id, | 
				
			||||
 | 
					                    'max_mark': self.mark, | 
				
			||||
 | 
					                    'pass_mark': self.pass_mark, | 
				
			||||
 | 
					                    'mark_scored': students.mark_scored, | 
				
			||||
 | 
					                    'is_pass': students.is_pass, | 
				
			||||
 | 
					                    'result_id': result.id, | 
				
			||||
 | 
					                } | 
				
			||||
 | 
					                result_line_obj.create(result_line_data) | 
				
			||||
 | 
					            else: | 
				
			||||
 | 
					                result_line_data = { | 
				
			||||
 | 
					                    'subject_id': self.subject_id.id, | 
				
			||||
 | 
					                    'max_mark': self.mark, | 
				
			||||
 | 
					                    'pass_mark': self.pass_mark, | 
				
			||||
 | 
					                    'mark_scored': students.mark_scored, | 
				
			||||
 | 
					                    'is_pass': students.is_pass, | 
				
			||||
 | 
					                    'result_id': search_result.id, | 
				
			||||
 | 
					                } | 
				
			||||
 | 
					                result_line_obj.create(result_line_data) | 
				
			||||
 | 
					        self.state = 'completed' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def action_set_to_draft(self): | 
				
			||||
 | 
					        """Method to set the record to the draft stage, | 
				
			||||
 | 
					                and it will unlink all exam results with this valuation.""" | 
				
			||||
 | 
					        for students in self.valuation_line_ids: | 
				
			||||
 | 
					            search_result = self.env['exam.result'].search( | 
				
			||||
 | 
					                [('exam_id', '=', self.exam_id.id), | 
				
			||||
 | 
					                 ('batch_id', '=', self.batch_id.id), | 
				
			||||
 | 
					                 ('student_id', '=', students.student_id.id)]) | 
				
			||||
 | 
					            search_result_line = self.env['results.subject.line'].search( | 
				
			||||
 | 
					                [('result_id', '=', search_result.id), | 
				
			||||
 | 
					                 ('subject_id', '=', self.subject_id.id)]) | 
				
			||||
 | 
					            search_result_line.unlink() | 
				
			||||
 | 
					            search_result.unlink() | 
				
			||||
 | 
					        self.state = 'draft' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def action_cancel_valuation(self): | 
				
			||||
 | 
					        """Action to cancel the valuation""" | 
				
			||||
 | 
					        self.state = 'cancel' | 
				
			||||
@ -0,0 +1,50 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import api, fields, models, _ | 
				
			||||
 | 
					from odoo.exceptions import UserError | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class ExamValuationLine(models.Model): | 
				
			||||
 | 
					    """Used to record the students pass mark details while valuing the exam""" | 
				
			||||
 | 
					    _name = 'exam.valuation.line' | 
				
			||||
 | 
					    _description = 'Exam Valuation Line' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    student_id = fields.Many2one('university.student', | 
				
			||||
 | 
					                                 string='Students', | 
				
			||||
 | 
					                                 help="Students of batch") | 
				
			||||
 | 
					    mark_scored = fields.Float(string='Mark', | 
				
			||||
 | 
					                               help="Scored mark of the student") | 
				
			||||
 | 
					    is_pass = fields.Boolean(string='Pass/Fail', | 
				
			||||
 | 
					                             help="Enable if the student pass the exam", | 
				
			||||
 | 
					                             default=False) | 
				
			||||
 | 
					    valuation_id = fields.Many2one('exam.valuation', | 
				
			||||
 | 
					                                   help="relation to exam valuation model", | 
				
			||||
 | 
					                                   string='Valuation Id') | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @api.onchange('mark_scored', 'is_pass') | 
				
			||||
 | 
					    def _onchange_mark_scored(self): | 
				
			||||
 | 
					        """to determine whether the scored mark exceeds the subject's | 
				
			||||
 | 
					          maximum mark and determine pass/fail depending on the scored mark.""" | 
				
			||||
 | 
					        if self.mark_scored > self.valuation_id.mark: | 
				
			||||
 | 
					            raise UserError(_('Mark Scored must be less than Max Mark')) | 
				
			||||
 | 
					        self.is_pass = True if \ | 
				
			||||
 | 
					            self.mark_scored >= self.valuation_id.pass_mark else False | 
				
			||||
@ -0,0 +1,40 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class FeeCategory(models.Model): | 
				
			||||
 | 
					    """For managing the categories for university fees""" | 
				
			||||
 | 
					    _name = 'fee.category' | 
				
			||||
 | 
					    _inherit = ['mail.thread', 'mail.activity.mixin'] | 
				
			||||
 | 
					    _description = "Categories of university fees" | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    name = fields.Char('Name', required=True, | 
				
			||||
 | 
					                       help='Create a fee category suitable for institution.' | 
				
			||||
 | 
					                            ' Like Institutional, Hostel, Transportation, ' | 
				
			||||
 | 
					                            'Arts and Sports, etc') | 
				
			||||
 | 
					    journal_id = fields.Many2one('account.journal', | 
				
			||||
 | 
					                                 domain="[('is_fee', '=', 'True')]", | 
				
			||||
 | 
					                                 required=True, string='Journal', | 
				
			||||
 | 
					                                 help='Setting up of unique journal ' | 
				
			||||
 | 
					                                      'for each category help to distinguish ' | 
				
			||||
 | 
					                                      'account entries of each category ') | 
				
			||||
@ -0,0 +1,57 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import api, fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class FeeStructure(models.Model): | 
				
			||||
 | 
					    """Managing the fee structure for university students""" | 
				
			||||
 | 
					    _name = 'fee.structure' | 
				
			||||
 | 
					    _inherit = ['mail.thread', 'mail.activity.mixin'] | 
				
			||||
 | 
					    _description = "Fees structure of university" | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    name = fields.Char('Name', required=True, | 
				
			||||
 | 
					                       help="Enter the name of fee structure") | 
				
			||||
 | 
					    currency_id = fields.Many2one('res.currency', string="Currency", | 
				
			||||
 | 
					                                  default=lambda | 
				
			||||
 | 
					                                      self: self.env.user.company_id.currency_id.id, | 
				
			||||
 | 
					                                  help="Currency of current company") | 
				
			||||
 | 
					    structure_line_ids = fields.One2many('fee.structure.line', | 
				
			||||
 | 
					                                         'fee_structure_id', | 
				
			||||
 | 
					                                         string='Fee Types', | 
				
			||||
 | 
					                                         help="Fee structure line") | 
				
			||||
 | 
					    description = fields.Text(string="Additional Information", | 
				
			||||
 | 
					                              help="Any additional information about") | 
				
			||||
 | 
					    academic_year_id = fields.Many2one('university.academic.year', | 
				
			||||
 | 
					                                       help="Choose academic year", | 
				
			||||
 | 
					                                       string='Academic Year', required=True) | 
				
			||||
 | 
					    amount_total = fields.Float(string="Amount", currency_field='currency_id', | 
				
			||||
 | 
					                                help="Total amount of the lines", | 
				
			||||
 | 
					                                required=True, compute='_compute_total') | 
				
			||||
 | 
					    category_id = fields.Many2one('fee.category', string='Category', | 
				
			||||
 | 
					                                  help="Select th category for structure", | 
				
			||||
 | 
					                                  required=True) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @api.depends('structure_line_ids.fee_amount') | 
				
			||||
 | 
					    def _compute_total(self): | 
				
			||||
 | 
					        """Method for computing total amount of the structure lines""" | 
				
			||||
 | 
					        self.amount_total = sum( | 
				
			||||
 | 
					            line.fee_amount for line in self.structure_line_ids) | 
				
			||||
@ -0,0 +1,50 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import api, fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class FeeStructureLines(models.Model): | 
				
			||||
 | 
					    _name = 'fee.structure.line' | 
				
			||||
 | 
					    _description = "Fee Structure lines" | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    fee_structure_id = fields.Many2one('fee.structure', | 
				
			||||
 | 
					                                       help="Relation to fee.structure", | 
				
			||||
 | 
					                                       string='Fee Structure', | 
				
			||||
 | 
					                                       ondelete='cascade', index=True) | 
				
			||||
 | 
					    category_id = fields.Many2one(related='fee_structure_id.category_id', | 
				
			||||
 | 
					                                  string="Category", | 
				
			||||
 | 
					                                  help="Fee category of structure") | 
				
			||||
 | 
					    fee_type_id = fields.Many2one('fee.type', string='Fee', | 
				
			||||
 | 
					                                  required=True, help="Select fee types") | 
				
			||||
 | 
					    currency_id = fields.Many2one('res.currency', string="Currency", | 
				
			||||
 | 
					                                  default=lambda | 
				
			||||
 | 
					                                      self: self.env.user.company_id.currency_id.id, | 
				
			||||
 | 
					                                  help="Currency of current company") | 
				
			||||
 | 
					    fee_amount = fields.Float('Amount', required=True, | 
				
			||||
 | 
					                              help="Amount of the each fee type", | 
				
			||||
 | 
					                              related='fee_type_id.lst_price') | 
				
			||||
 | 
					    payment_type = fields.Selection(string='Payment Type', | 
				
			||||
 | 
					                                    help="Payment type of fee type", | 
				
			||||
 | 
					                                    related="fee_type_id.payment_type") | 
				
			||||
 | 
					    fee_description = fields.Text('Description', help="Fee type " | 
				
			||||
 | 
					                                                      "description", | 
				
			||||
 | 
					                                  related='fee_type_id.description_sale') | 
				
			||||
@ -0,0 +1,46 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class FeeTypes(models.Model): | 
				
			||||
 | 
					    """For managing payment method or type of student fees""" | 
				
			||||
 | 
					    _name = 'fee.type' | 
				
			||||
 | 
					    _inherit = ['mail.thread', 'mail.activity.mixin'] | 
				
			||||
 | 
					    _inherits = {'product.product': 'product_id'} | 
				
			||||
 | 
					    _description = 'University fees' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    payment_type = fields.Selection([ | 
				
			||||
 | 
					        ('onetime', 'One Time'), | 
				
			||||
 | 
					        ('permonth', 'Per Month'), | 
				
			||||
 | 
					        ('peryear', 'Per Year'), | 
				
			||||
 | 
					        ('sixmonth', '6 Months'), | 
				
			||||
 | 
					        ('threemonth', '3 Months')], | 
				
			||||
 | 
					        string='Payment Type', default='permonth', | 
				
			||||
 | 
					        help='Payment type describe how much a payment effective') | 
				
			||||
 | 
					    category_id = fields.Many2one('fee.category', string='Category', | 
				
			||||
 | 
					                                  help="Category of fee types", | 
				
			||||
 | 
					                                  required=True) | 
				
			||||
 | 
					    currency_id = fields.Many2one('res.currency', string="Currency", | 
				
			||||
 | 
					                                  default=lambda | 
				
			||||
 | 
					                                      self: self.env.user.company_id.currency_id.id, | 
				
			||||
 | 
					                                  help="Currency of current company") | 
				
			||||
@ -0,0 +1,30 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class RejectReason(models.Model): | 
				
			||||
 | 
					    """For managing rejection reasons for an application""" | 
				
			||||
 | 
					    _name = 'reject.reason' | 
				
			||||
 | 
					    _description = "Application reject reasons" | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    name = fields.Char(string="Name", help="Reject Reasons of application") | 
				
			||||
@ -0,0 +1,33 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class ResPartner(models.Model): | 
				
			||||
 | 
					    """Inherited model for adding two fields to determine | 
				
			||||
 | 
					                    whether the partner student or parent""" | 
				
			||||
 | 
					    _inherit = 'res.partner' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    is_student = fields.Boolean(string="Is a Student", | 
				
			||||
 | 
					                                help="Enable if the partner is a student") | 
				
			||||
 | 
					    is_parent = fields.Boolean(string="Is a Parent", | 
				
			||||
 | 
					                               help="Enable if the partner is a parent") | 
				
			||||
@ -0,0 +1,43 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class ResultsSubjectLine(models.Model): | 
				
			||||
 | 
					    """Used to manage subject details of student exam result""" | 
				
			||||
 | 
					    _name = 'results.subject.line' | 
				
			||||
 | 
					    _description = 'Results Subject Line' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    name = fields.Char(string='Name', help="Name of the result") | 
				
			||||
 | 
					    subject_id = fields.Many2one('university.subject', | 
				
			||||
 | 
					                                 string='Subject', | 
				
			||||
 | 
					                                 help="Subjects of the exam") | 
				
			||||
 | 
					    max_mark = fields.Float(string='Max Mark', help="Maximum mark of subject") | 
				
			||||
 | 
					    pass_mark = fields.Float(string='Pass Mark', | 
				
			||||
 | 
					                             help="Pass mark of the subject") | 
				
			||||
 | 
					    mark_scored = fields.Float(string='Mark Scored', | 
				
			||||
 | 
					                               help="Marks scored by the students in subjects") | 
				
			||||
 | 
					    is_pass = fields.Boolean(string='Pass/Fail', | 
				
			||||
 | 
					                             help="Enable if the student " | 
				
			||||
 | 
					                                  "pass the subject") | 
				
			||||
 | 
					    result_id = fields.Many2one('exam.result', string='Result Id', | 
				
			||||
 | 
					                                help="Relation to result model") | 
				
			||||
@ -0,0 +1,38 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class TimetablePeriod(models.Model): | 
				
			||||
 | 
					    """Manages the period details """ | 
				
			||||
 | 
					    _name = 'timetable.period' | 
				
			||||
 | 
					    _inherit = ['mail.thread', 'mail.activity.mixin'] | 
				
			||||
 | 
					    _description = 'Timetable Period' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    name = fields.Char(string="Name", required=True, help="Enter Period Name") | 
				
			||||
 | 
					    time_from = fields.Float(string='From', required=True, | 
				
			||||
 | 
					                             help="Start and End time of Period.") | 
				
			||||
 | 
					    time_to = fields.Float(string='To', required=True, | 
				
			||||
 | 
					                           help="Start and End time of Period.") | 
				
			||||
 | 
					    company_id = fields.Many2one( | 
				
			||||
 | 
					        'res.company', string='Company', help="Current company", | 
				
			||||
 | 
					        default=lambda self: self.env.company) | 
				
			||||
@ -0,0 +1,72 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import api, fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class TimeTableScheduleLine(models.Model): | 
				
			||||
 | 
					    """ Manages the schedule for subjects and faculty while | 
				
			||||
 | 
					        creating timetable""" | 
				
			||||
 | 
					    _name = 'timetable.schedule.line' | 
				
			||||
 | 
					    _description = 'Timetable Schedule' | 
				
			||||
 | 
					    _rec_name = 'period_id' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    period_id = fields.Many2one('timetable.period', | 
				
			||||
 | 
					                                string="Period", required=True, | 
				
			||||
 | 
					                                help="select period") | 
				
			||||
 | 
					    faculty_id = fields.Many2one('university.faculty', | 
				
			||||
 | 
					                                 string='Faculty', required=True, | 
				
			||||
 | 
					                                 help="Set faculty who is taking ") | 
				
			||||
 | 
					    time_from = fields.Float(string='From', related='period_id.time_from', | 
				
			||||
 | 
					                             readonly=False, | 
				
			||||
 | 
					                             help="Start and End time of Period.") | 
				
			||||
 | 
					    time_till = fields.Float(string='Till', related='period_id.time_to', | 
				
			||||
 | 
					                             readonly=False, | 
				
			||||
 | 
					                             help="Start and End time of Period.") | 
				
			||||
 | 
					    subject = fields.Many2one('university.subject', | 
				
			||||
 | 
					                              string='Subjects', required=True, | 
				
			||||
 | 
					                              help="Select the subject to schedule timetable") | 
				
			||||
 | 
					    week_day = fields.Selection([ | 
				
			||||
 | 
					        ('0', 'Monday'), | 
				
			||||
 | 
					        ('1', 'Tuesday'), | 
				
			||||
 | 
					        ('2', 'Wednesday'), | 
				
			||||
 | 
					        ('3', 'Thursday'), | 
				
			||||
 | 
					        ('4', 'Friday'), | 
				
			||||
 | 
					        ('5', 'Saturday'), | 
				
			||||
 | 
					        ('6', 'Sunday'), | 
				
			||||
 | 
					    ], string='Week', required=True, help="Select week for scheduling period") | 
				
			||||
 | 
					    timetable_id = fields.Many2one('university.timetable', | 
				
			||||
 | 
					                                   required=True, string="Timetable", | 
				
			||||
 | 
					                                   help="Relation to university.timetable") | 
				
			||||
 | 
					    batch_id = fields.Many2one('university.batch', string='Batch', | 
				
			||||
 | 
					                               help="Batch") | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @api.model | 
				
			||||
 | 
					    def create(self, vals): | 
				
			||||
 | 
					        """ This method overrides the create method to automatically store | 
				
			||||
 | 
					            :param vals (dict): Dictionary containing the field values for the | 
				
			||||
 | 
					                                new timetable schedule line. | 
				
			||||
 | 
					            :returns class:`timetable.schedule.line`The created timetable | 
				
			||||
 | 
					                            schedule line record. | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        res = super(TimeTableScheduleLine, self).create(vals) | 
				
			||||
 | 
					        res.batch_id = res.timetable_id.batch_id.id | 
				
			||||
 | 
					        return res | 
				
			||||
@ -0,0 +1,39 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class UniversityAcademicYear(models.Model): | 
				
			||||
 | 
					    """For managing university academic year""" | 
				
			||||
 | 
					    _name = 'university.academic.year' | 
				
			||||
 | 
					    _inherit = ['mail.thread', 'mail.activity.mixin'] | 
				
			||||
 | 
					    _description = "University Academic Year" | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    name = fields.Char(string="Name", help="Name of the academic year") | 
				
			||||
 | 
					    start_date = fields.Date(string="Start Date", required=True, | 
				
			||||
 | 
					                             help="Enter the start date of the academic year") | 
				
			||||
 | 
					    end_date = fields.Date(string="End Date", required=True, | 
				
			||||
 | 
					                           help="Enter the end date of the academic year") | 
				
			||||
 | 
					    is_active = fields.Boolean( | 
				
			||||
 | 
					        'Active', default=True, | 
				
			||||
 | 
					        help="If unchecked, it will allow you to hide the Academic " | 
				
			||||
 | 
					             "Year without removing it.") | 
				
			||||
@ -0,0 +1,361 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import api, fields, models, _ | 
				
			||||
 | 
					from odoo.exceptions import ValidationError | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class UniversityApplication(models.Model): | 
				
			||||
 | 
					    """ For managing student applications to the courses of the university""" | 
				
			||||
 | 
					    _name = 'university.application' | 
				
			||||
 | 
					    _inherit = ['mail.thread', 'mail.activity.mixin'] | 
				
			||||
 | 
					    _description = 'Applications for the admission' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @api.model | 
				
			||||
 | 
					    def create(self, vals): | 
				
			||||
 | 
					        """Overriding the create method and assigning | 
				
			||||
 | 
					            the sequence for the record""" | 
				
			||||
 | 
					        if vals.get('application_no', _('New')) == _('New'): | 
				
			||||
 | 
					            vals['application_no'] = self.env['ir.sequence'].next_by_code( | 
				
			||||
 | 
					                'university.application') or _('New') | 
				
			||||
 | 
					        res = super(UniversityApplication, self).create(vals) | 
				
			||||
 | 
					        return res | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    name = fields.Char(string='Name', required=True, | 
				
			||||
 | 
					                       help="Enter First name of Student") | 
				
			||||
 | 
					    middle_name = fields.Char(string='Middle Name', | 
				
			||||
 | 
					                              help="Enter Middle name of Student") | 
				
			||||
 | 
					    last_name = fields.Char(string='Last Name', | 
				
			||||
 | 
					                            help="Enter Last name of Student") | 
				
			||||
 | 
					    image = fields.Binary(string='Image', | 
				
			||||
 | 
					                          attachment=True, | 
				
			||||
 | 
					                          help="Provide the image of the Student") | 
				
			||||
 | 
					    academic_year_id = fields.Many2one( | 
				
			||||
 | 
					        'university.academic.year', | 
				
			||||
 | 
					        string='Academic Year', | 
				
			||||
 | 
					        help="Choose Academic year for which the admission is choosing") | 
				
			||||
 | 
					    course_id = fields.Many2one( | 
				
			||||
 | 
					        'university.course', string="Course", | 
				
			||||
 | 
					        required=True, | 
				
			||||
 | 
					        help="Enter Course to which the admission is seeking") | 
				
			||||
 | 
					    department_ids = fields.Many2many( | 
				
			||||
 | 
					        'university.department', string="Department", | 
				
			||||
 | 
					        compute="_compute_department_ids", | 
				
			||||
 | 
					        help="Enter department to which the admission is seeking") | 
				
			||||
 | 
					    department_id = fields.Many2one( | 
				
			||||
 | 
					        'university.department', string="Department", | 
				
			||||
 | 
					        required=True, | 
				
			||||
 | 
					        help="Enter department to which the admission is seeking") | 
				
			||||
 | 
					    semester_ids = fields.Many2many('university.semester', | 
				
			||||
 | 
					                                    string="Semester", | 
				
			||||
 | 
					                                    compute="_compute_semester_ids", | 
				
			||||
 | 
					                                    help="Enter semester to which the " | 
				
			||||
 | 
					                                         "admission is seeking") | 
				
			||||
 | 
					    semester_id = fields.Many2one('university.semester', | 
				
			||||
 | 
					                                  string="Semester", required=True, | 
				
			||||
 | 
					                                  help="Enter semester to which the admission " | 
				
			||||
 | 
					                                       "is seeking") | 
				
			||||
 | 
					    batch_ids = fields.Many2many('university.batch', | 
				
			||||
 | 
					                                 string="Batch", compute="_compute_batch_ids", | 
				
			||||
 | 
					                                 help="Enter batch to which the " | 
				
			||||
 | 
					                                      "admission is seeking") | 
				
			||||
 | 
					    batch_id = fields.Many2one('university.batch', string="Batch", | 
				
			||||
 | 
					                               help="Enter batch to which the " | 
				
			||||
 | 
					                                    "admission is seeking") | 
				
			||||
 | 
					    admission_date = fields.Datetime('Admission Date', | 
				
			||||
 | 
					                                     help="Admission Taken date", | 
				
			||||
 | 
					                                     default=fields.Datetime.now, | 
				
			||||
 | 
					                                     required=True) | 
				
			||||
 | 
					    application_no = fields.Char(string='Application  No', | 
				
			||||
 | 
					                                 help="Application number of new admission", | 
				
			||||
 | 
					                                 readonly=True, default=lambda self: _('New')) | 
				
			||||
 | 
					    company_id = fields.Many2one('res.company', string='Company', | 
				
			||||
 | 
					                                 help="Company of the application", | 
				
			||||
 | 
					                                 default=lambda self: self.env.user.company_id) | 
				
			||||
 | 
					    email = fields.Char(string="Email", required=True, | 
				
			||||
 | 
					                        help="Enter E-mail id for contact purpose") | 
				
			||||
 | 
					    phone = fields.Char(string="Phone", | 
				
			||||
 | 
					                        help="Enter Phone no. for contact purpose") | 
				
			||||
 | 
					    mobile = fields.Char(string="Mobile", required=True, | 
				
			||||
 | 
					                         help="Enter Mobile num for contact purpose") | 
				
			||||
 | 
					    nationality_id = fields.Many2one('res.country', | 
				
			||||
 | 
					                                     string='Nationality', ondelete='restrict', | 
				
			||||
 | 
					                                     help="Select the Nationality") | 
				
			||||
 | 
					    mother_tongue = fields.Char(string="Mother Tongue", | 
				
			||||
 | 
					                                help="Enter Student's Mother Tongue") | 
				
			||||
 | 
					    religion = fields.Char(string="Religion", | 
				
			||||
 | 
					                           help="My Religion is ") | 
				
			||||
 | 
					    caste = fields.Char(string="Caste", | 
				
			||||
 | 
					                        help="My Caste is ") | 
				
			||||
 | 
					    street = fields.Char(string='Street', help="Enter the street") | 
				
			||||
 | 
					    street2 = fields.Char(string='Street2', help="Enter the street2") | 
				
			||||
 | 
					    zip = fields.Char(change_default=True, string='ZIP code', | 
				
			||||
 | 
					                      help="Enter the Zip Code") | 
				
			||||
 | 
					    city = fields.Char(string='City', help="Enter the City name") | 
				
			||||
 | 
					    state_id = fields.Many2one("res.country.state", string='State', | 
				
			||||
 | 
					                               ondelete='restrict', | 
				
			||||
 | 
					                               help="Select the State where you are from") | 
				
			||||
 | 
					    country_id = fields.Many2one('res.country', string='Country', | 
				
			||||
 | 
					                                 ondelete='restrict', | 
				
			||||
 | 
					                                 help="Select the Country") | 
				
			||||
 | 
					    is_same_address = fields.Boolean( | 
				
			||||
 | 
					        string="Permanent Address same as above", | 
				
			||||
 | 
					        default=True, | 
				
			||||
 | 
					        help="Tick the field if the Present and permanent address is same") | 
				
			||||
 | 
					    per_street = fields.Char(string='Street', help="Enter the street") | 
				
			||||
 | 
					    per_street2 = fields.Char(string='Street2', help="Enter the street2") | 
				
			||||
 | 
					    per_zip = fields.Char(change_default=True, string='ZIP code', | 
				
			||||
 | 
					                          help="Enter the Zip Code") | 
				
			||||
 | 
					    per_city = fields.Char(string='City', help="Enter the City name") | 
				
			||||
 | 
					    per_state_id = fields.Many2one("res.country.state", | 
				
			||||
 | 
					                                   string='State', ondelete='restrict', | 
				
			||||
 | 
					                                   help="Select the State where you are from") | 
				
			||||
 | 
					    per_country_id = fields.Many2one('res.country', | 
				
			||||
 | 
					                                     string='Country', ondelete='restrict', | 
				
			||||
 | 
					                                     help="Select the Country") | 
				
			||||
 | 
					    date_of_birth = fields.Date(string="Date of Birth", required=True, | 
				
			||||
 | 
					                                help="Enter your DOB") | 
				
			||||
 | 
					    guardian_id = fields.Many2one('res.partner', string="Guardian", | 
				
			||||
 | 
					                                  domain=[('is_parent', '=', True)], | 
				
			||||
 | 
					                                  required=True, | 
				
			||||
 | 
					                                  help="Tell us who will take care of you") | 
				
			||||
 | 
					    description = fields.Text(string="Note", | 
				
			||||
 | 
					                              help="Description about the application") | 
				
			||||
 | 
					    father_name = fields.Char(string="Father", help="My father is") | 
				
			||||
 | 
					    mother_name = fields.Char(string="Mother", help="My mother's name is") | 
				
			||||
 | 
					    active = fields.Boolean(string='Active', default=True, | 
				
			||||
 | 
					                            help="Is the application is active or not") | 
				
			||||
 | 
					    document_count = fields.Integer(compute='_compute_document_count', | 
				
			||||
 | 
					                                    string='# Documents', | 
				
			||||
 | 
					                                    help="Number of documents of application") | 
				
			||||
 | 
					    verified_by_id = fields.Many2one('res.users', | 
				
			||||
 | 
					                                     string='Verified by', | 
				
			||||
 | 
					                                     help="The Document is verified by") | 
				
			||||
 | 
					    reject_reason = fields.Many2one('reject.reason', | 
				
			||||
 | 
					                                    string='Reject Reason', | 
				
			||||
 | 
					                                    help="Application is rejected because") | 
				
			||||
 | 
					    gender = fields.Selection( | 
				
			||||
 | 
					        [('male', 'Male'), ('female', 'Female'), ('other', 'Other')], | 
				
			||||
 | 
					        string='Gender', required=True, default='male', | 
				
			||||
 | 
					        track_visibility='onchange', | 
				
			||||
 | 
					        help="Your Gender is") | 
				
			||||
 | 
					    blood_group = fields.Selection( | 
				
			||||
 | 
					        [('a+', 'A+'), ('a-', 'A-'), ('b+', 'B+'), ('o+', 'O+'), | 
				
			||||
 | 
					         ('o-', 'O-'), ('ab-', 'AB-'), ('ab+', 'AB+')], string='Blood Group', | 
				
			||||
 | 
					        required=True, default='a+', track_visibility='onchange', | 
				
			||||
 | 
					        help="Your Blood Group is") | 
				
			||||
 | 
					    state = fields.Selection([('draft', 'Draft'), | 
				
			||||
 | 
					                              ('verification', 'Verify'), | 
				
			||||
 | 
					                              ('approve', 'Approve'), ('reject', 'Rejected'), | 
				
			||||
 | 
					                              ('done', 'Done')], string='State', required=True, | 
				
			||||
 | 
					                             default='draft', track_visibility='onchange', | 
				
			||||
 | 
					                             help="Status of the application") | 
				
			||||
 | 
					    prev_institute = fields.Char('Previous Institute', | 
				
			||||
 | 
					                                 help="Previously studied institution", | 
				
			||||
 | 
					                                 states={'done': [('readonly', True)]}) | 
				
			||||
 | 
					    prev_course = fields.Char('Previous Course', | 
				
			||||
 | 
					                              help="Previously studied course", | 
				
			||||
 | 
					                              states={'done': [('readonly', True)]}) | 
				
			||||
 | 
					    prev_result = fields.Char('Previous Result', | 
				
			||||
 | 
					                              help="Previously studied institution", | 
				
			||||
 | 
					                              states={'done': [('readonly', True)]}) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def _compute_document_count(self): | 
				
			||||
 | 
					        """Return the count of the documents provided""" | 
				
			||||
 | 
					        for rec in self: | 
				
			||||
 | 
					            rec.document_count = self.env['university.document'].search_count( | 
				
			||||
 | 
					                [('application_ref_id', '=', rec.id)]) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def action_document_view(self): | 
				
			||||
 | 
					        """ smart button action of viewing list of documents of application | 
				
			||||
 | 
					            :return dict: the list of documents view | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        return { | 
				
			||||
 | 
					            'name': _('Documents'), | 
				
			||||
 | 
					            'domain': [('application_ref_id', '=', self.id)], | 
				
			||||
 | 
					            'res_model': 'university.document', | 
				
			||||
 | 
					            'type': 'ir.actions.act_window', | 
				
			||||
 | 
					            'view_id': False, | 
				
			||||
 | 
					            'view_mode': 'tree,form', | 
				
			||||
 | 
					            'context': {'default_application_ref_id': self.id} | 
				
			||||
 | 
					        } | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def action_send_verification(self): | 
				
			||||
 | 
					        """Button action for sending the application for the verification""" | 
				
			||||
 | 
					        for rec in self: | 
				
			||||
 | 
					            if not self.env['university.document'].search( | 
				
			||||
 | 
					                    [('application_ref_id', '=', rec.id)]): | 
				
			||||
 | 
					                raise ValidationError(_('No Documents provided')) | 
				
			||||
 | 
					            rec.write({ | 
				
			||||
 | 
					                'state': 'verification' | 
				
			||||
 | 
					            }) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def action_verify_application(self): | 
				
			||||
 | 
					        """ This method checks the status of documents related to the student | 
				
			||||
 | 
					            application. If no documents are provided or if the provided | 
				
			||||
 | 
					            documents are not in the 'done' state, it raises a validation error | 
				
			||||
 | 
					            Otherwise, it updates the verification status of the application | 
				
			||||
 | 
					            and approves it. | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					            :raises ValidationError: If all documents are not verified or no | 
				
			||||
 | 
					                documents are provided. | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        for rec in self: | 
				
			||||
 | 
					            doc_status = self.env['university.document'].search( | 
				
			||||
 | 
					                [('application_ref_id', '=', rec.id)]).mapped('state') | 
				
			||||
 | 
					            if doc_status: | 
				
			||||
 | 
					                if all(state in 'done' for state in doc_status): | 
				
			||||
 | 
					                    rec.write({ | 
				
			||||
 | 
					                        'verified_by_id': self.env.uid, | 
				
			||||
 | 
					                        'state': 'approve' | 
				
			||||
 | 
					                    }) | 
				
			||||
 | 
					                else: | 
				
			||||
 | 
					                    raise ValidationError( | 
				
			||||
 | 
					                        _('All Documents are not Verified Yet, ' | 
				
			||||
 | 
					                          'Please complete the verification')) | 
				
			||||
 | 
					            else: | 
				
			||||
 | 
					                raise ValidationError(_('No Documents provided')) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def action_reject(self): | 
				
			||||
 | 
					        """This method updates the state of the student application to 'reject', | 
				
			||||
 | 
					            indicating that the application has been rejected for admission. | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        for rec in self: | 
				
			||||
 | 
					            rec.write({ | 
				
			||||
 | 
					                'state': 'reject' | 
				
			||||
 | 
					            }) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def action_create_student(self): | 
				
			||||
 | 
					        """ This method creates a new student record using the data from the | 
				
			||||
 | 
					             application.It populates the student record with the relevant | 
				
			||||
 | 
					             information. It also assigns a user login for the student. | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					            :returns dict: A dictionary containing the information required | 
				
			||||
 | 
					                            to open the student form view. | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        for rec in self: | 
				
			||||
 | 
					            values = { | 
				
			||||
 | 
					                'name': rec.name, | 
				
			||||
 | 
					                'last_name': rec.last_name, | 
				
			||||
 | 
					                'middle_name': rec.middle_name, | 
				
			||||
 | 
					                'application_id': rec.id, | 
				
			||||
 | 
					                'father_name': rec.father_name, | 
				
			||||
 | 
					                'mother_name': rec.mother_name, | 
				
			||||
 | 
					                'guardian_id': rec.guardian_id.id, | 
				
			||||
 | 
					                'street': rec.street, | 
				
			||||
 | 
					                'street2': rec.street2, | 
				
			||||
 | 
					                'city': rec.city, | 
				
			||||
 | 
					                'state_id': rec.state_id.id, | 
				
			||||
 | 
					                'country_id': rec.country_id.id, | 
				
			||||
 | 
					                'zip': rec.zip, | 
				
			||||
 | 
					                'is_same_address': rec.is_same_address, | 
				
			||||
 | 
					                'per_street': rec.per_street, | 
				
			||||
 | 
					                'per_street2': rec.per_street2, | 
				
			||||
 | 
					                'per_city': rec.per_city, | 
				
			||||
 | 
					                'per_state_id': rec.per_state_id.id, | 
				
			||||
 | 
					                'per_country_id': rec.per_country_id.id, | 
				
			||||
 | 
					                'per_zip': rec.per_zip, | 
				
			||||
 | 
					                'gender': rec.gender, | 
				
			||||
 | 
					                'date_of_birth': rec.date_of_birth, | 
				
			||||
 | 
					                'blood_group': rec.blood_group, | 
				
			||||
 | 
					                'nationality_id': rec.nationality_id.id, | 
				
			||||
 | 
					                'email': rec.email, | 
				
			||||
 | 
					                'mobile': rec.mobile, | 
				
			||||
 | 
					                'phone': rec.phone, | 
				
			||||
 | 
					                'image_1920': rec.image, | 
				
			||||
 | 
					                'is_student': True, | 
				
			||||
 | 
					                'religion': rec.religion, | 
				
			||||
 | 
					                'caste': rec.caste, | 
				
			||||
 | 
					                'mother_tongue': rec.mother_tongue, | 
				
			||||
 | 
					                'semester_id': rec.semester_id.id, | 
				
			||||
 | 
					                'academic_year_id': rec.academic_year_id.id, | 
				
			||||
 | 
					                'company_id': rec.company_id.id, | 
				
			||||
 | 
					                'batch_id': rec.batch_id.id, | 
				
			||||
 | 
					            } | 
				
			||||
 | 
					            if not rec.is_same_address: | 
				
			||||
 | 
					                pass | 
				
			||||
 | 
					            else: | 
				
			||||
 | 
					                values.update({ | 
				
			||||
 | 
					                    'per_street': rec.street, | 
				
			||||
 | 
					                    'per_street2': rec.street2, | 
				
			||||
 | 
					                    'per_city': rec.city, | 
				
			||||
 | 
					                    'per_state_id': rec.state_id.id, | 
				
			||||
 | 
					                    'per_country_id': rec.country_id.id, | 
				
			||||
 | 
					                    'per_zip': rec.zip, | 
				
			||||
 | 
					                }) | 
				
			||||
 | 
					            student = self.env['university.student'].create(values) | 
				
			||||
 | 
					            student.user_id = self.env['res.users'].create({ | 
				
			||||
 | 
					                'name': student.name, | 
				
			||||
 | 
					                'login': student.email, | 
				
			||||
 | 
					                'partner_id': student.partner_id.id, | 
				
			||||
 | 
					                'groups_id': [(6, 0, [self.env.ref('base.group_portal').id])] | 
				
			||||
 | 
					            }) | 
				
			||||
 | 
					            rec.write({ | 
				
			||||
 | 
					                'state': 'done' | 
				
			||||
 | 
					            }) | 
				
			||||
 | 
					            return { | 
				
			||||
 | 
					                'name': _('Student'), | 
				
			||||
 | 
					                'view_mode': 'form', | 
				
			||||
 | 
					                'res_model': 'university.student', | 
				
			||||
 | 
					                'type': 'ir.actions.act_window', | 
				
			||||
 | 
					                'res_id': student.id, | 
				
			||||
 | 
					                'context': self.env.context | 
				
			||||
 | 
					            } | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @api.depends('course_id') | 
				
			||||
 | 
					    def _compute_department_ids(self): | 
				
			||||
 | 
					        """ To find the departments in the selected course and assign them | 
				
			||||
 | 
					            to department_ids field for setting domain for department_id field | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        for rec in self: | 
				
			||||
 | 
					            rec.department_ids = self.env['university.department'].search( | 
				
			||||
 | 
					                [('course_id', '=', | 
				
			||||
 | 
					                  self.course_id.id)]).ids if rec.course_id else False | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @api.depends('department_id') | 
				
			||||
 | 
					    def _compute_semester_ids(self): | 
				
			||||
 | 
					        """ To find the semester in the selected department and assign them | 
				
			||||
 | 
					            to semester_ids field for setting domain for semester_id field | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        for rec in self: | 
				
			||||
 | 
					            rec.semester_ids = self.env['university.semester'].search( | 
				
			||||
 | 
					                [('department_id', '=', | 
				
			||||
 | 
					                  self.department_id.id)]).ids if rec.department_id else False | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @api.depends('semester_id') | 
				
			||||
 | 
					    def _compute_batch_ids(self): | 
				
			||||
 | 
					        """ To find the batch in the selected semester and assign them | 
				
			||||
 | 
					            to batch_ids field. | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        for rec in self: | 
				
			||||
 | 
					            rec.batch_ids = self.env['university.batch'].search( | 
				
			||||
 | 
					                [('semester_id', '=', | 
				
			||||
 | 
					                  self.semester_id.id)]).ids if rec.semester_id else False | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @api.onchange('date_of_birth') | 
				
			||||
 | 
					    def _onchange_date_of_birth(self): | 
				
			||||
 | 
					        """ It checks if the provided date of birth makes the person under | 
				
			||||
 | 
					            18 years old. | 
				
			||||
 | 
					            :raises ValidationError: If the person is under 18. | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        if self.date_of_birth: | 
				
			||||
 | 
					            if (fields.date.today().year - self.date_of_birth.year) < 18: | 
				
			||||
 | 
					                raise ValidationError(_('Please provide valid date of birth')) | 
				
			||||
@ -0,0 +1,119 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import api, fields, models, _ | 
				
			||||
 | 
					from odoo.exceptions import UserError, ValidationError | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class UniversityAttendance(models.Model): | 
				
			||||
 | 
					    """For managing student daily attendance details""" | 
				
			||||
 | 
					    _name = 'university.attendance' | 
				
			||||
 | 
					    _inherit = ['mail.thread', 'mail.activity.mixin'] | 
				
			||||
 | 
					    _description = "University Student attendance" | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    name = fields.Char(string="Name", default="New", | 
				
			||||
 | 
					                       help="Name of the attendance") | 
				
			||||
 | 
					    batch_id = fields.Many2one('university.batch', string="Batch", | 
				
			||||
 | 
					                               required=True, | 
				
			||||
 | 
					                               help="Select batch for the attendance") | 
				
			||||
 | 
					    faculty_id = fields.Many2one(related='batch_id.faculty_id', | 
				
			||||
 | 
					                                 string="Faculty", | 
				
			||||
 | 
					                                 help="Faculty in charge for the batch") | 
				
			||||
 | 
					    date = fields.Date(string="Date", default=fields.Date.today, required=True, | 
				
			||||
 | 
					                       help="Select date of attendance") | 
				
			||||
 | 
					    attendance_line_ids = fields.One2many('university.attendance.line', | 
				
			||||
 | 
					                                          'attendance_id', | 
				
			||||
 | 
					                                          string='Attendance Line', | 
				
			||||
 | 
					                                          help="Students attendance " | 
				
			||||
 | 
					                                               "list/attendance line") | 
				
			||||
 | 
					    state = fields.Selection([('draft', 'Draft'), ('done', 'Done')], | 
				
			||||
 | 
					                             default='draft', help="Status of attendance") | 
				
			||||
 | 
					    is_all_marked_morning = fields.Boolean( | 
				
			||||
 | 
					        string='All students are present in the morning', | 
				
			||||
 | 
					        help="Is all student present in the morning") | 
				
			||||
 | 
					    is_all_marked_afternoon = fields.Boolean( | 
				
			||||
 | 
					        string='All students are present in the afternoon', | 
				
			||||
 | 
					        help="Is all student present in the afternoon") | 
				
			||||
 | 
					    is_attendance_created = fields.Boolean(string='Attendance Created', | 
				
			||||
 | 
					                                           help="Is Attendance created or not") | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @api.onchange('batch_id') | 
				
			||||
 | 
					    def _onchange_batch_id(self): | 
				
			||||
 | 
					        """ Method to clear the attendance line if the batch is changed """ | 
				
			||||
 | 
					        if self.batch_id: | 
				
			||||
 | 
					            self.is_attendance_created = False | 
				
			||||
 | 
					            self.attendance_line_ids = False | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def action_create_attendance_line(self): | 
				
			||||
 | 
					        """Action to create attendance line with students in the batch""" | 
				
			||||
 | 
					        if self.search_count( | 
				
			||||
 | 
					                [('batch_id', '=', self.batch_id.id), ('date', '=', self.date), | 
				
			||||
 | 
					                 ('state', '=', 'done')]) == 1: | 
				
			||||
 | 
					            raise ValidationError( | 
				
			||||
 | 
					                _('Attendance for this batch on this date already exists.')) | 
				
			||||
 | 
					        self.name = str(self.date) | 
				
			||||
 | 
					        if len(self.batch_id.batch_student_ids) < 1: | 
				
			||||
 | 
					            raise UserError(_('There are no students in this Batch')) | 
				
			||||
 | 
					        for student in self.batch_id.batch_student_ids: | 
				
			||||
 | 
					            self.env['university.attendance.line'].create( | 
				
			||||
 | 
					                {'name': self.name, | 
				
			||||
 | 
					                 'attendance_id': self.id, | 
				
			||||
 | 
					                 'student_id': student.id, | 
				
			||||
 | 
					                 'batch_id': self.batch_id.id, | 
				
			||||
 | 
					                 'date': self.date, }) | 
				
			||||
 | 
					        self.is_attendance_created = True | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def action_mark_all_present_morning(self): | 
				
			||||
 | 
					        """Action to mark all marked presents of students in the morning""" | 
				
			||||
 | 
					        for records in self.attendance_line_ids: | 
				
			||||
 | 
					            records.is_present_morning = True | 
				
			||||
 | 
					        self.is_all_marked_morning = True | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def action_un_mark_all_present_morning(self): | 
				
			||||
 | 
					        """Action to unmark all marked presents of students in the morning""" | 
				
			||||
 | 
					        for records in self.attendance_line_ids: | 
				
			||||
 | 
					            records.is_present_morning = False | 
				
			||||
 | 
					        self.is_all_marked_morning = False | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def action_mark_all_present_afternoon(self): | 
				
			||||
 | 
					        """Action to mark all marked presents of students in the afternoon""" | 
				
			||||
 | 
					        for records in self.attendance_line_ids: | 
				
			||||
 | 
					            records.is_present_afternoon = True | 
				
			||||
 | 
					        self.is_all_marked_afternoon = True | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def action_un_mark_all_present_afternoon(self): | 
				
			||||
 | 
					        """Action to unmark all marked presents of students in the afternoon""" | 
				
			||||
 | 
					        for records in self.attendance_line_ids: | 
				
			||||
 | 
					            records.is_present_afternoon = False | 
				
			||||
 | 
					        self.is_all_marked_afternoon = False | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def action_attendance_done(self): | 
				
			||||
 | 
					        """To compute absent of student is half/full day and | 
				
			||||
 | 
					                        make the attendance to done stage""" | 
				
			||||
 | 
					        for records in self.attendance_line_ids: | 
				
			||||
 | 
					            if not records.is_present_morning and \ | 
				
			||||
 | 
					                    not records.is_present_afternoon: | 
				
			||||
 | 
					                records.full_day_absent = 1 | 
				
			||||
 | 
					            elif not records.is_present_morning: | 
				
			||||
 | 
					                records.half_day_absent = 1 | 
				
			||||
 | 
					            elif not records.is_present_afternoon: | 
				
			||||
 | 
					                records.half_day_absent = 1 | 
				
			||||
 | 
					        self.state = 'done' | 
				
			||||
@ -0,0 +1,51 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class UniversityAttendanceLine(models.Model): | 
				
			||||
 | 
					    """For recording if the student is present during the day or not.""" | 
				
			||||
 | 
					    _name = 'university.attendance.line' | 
				
			||||
 | 
					    _inherit = ['mail.thread', 'mail.activity.mixin'] | 
				
			||||
 | 
					    _description = 'Attendance Lines' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    name = fields.Char(string='Name', help="Name of the attendance") | 
				
			||||
 | 
					    attendance_id = fields.Many2one('university.attendance', | 
				
			||||
 | 
					                                    string='Attendance Id', | 
				
			||||
 | 
					                                    help="Relation field to attendance module") | 
				
			||||
 | 
					    student_id = fields.Many2one('university.student', | 
				
			||||
 | 
					                                 string='Student', | 
				
			||||
 | 
					                                 help="Students of the batch") | 
				
			||||
 | 
					    is_present_morning = fields.Boolean(string='Morning', | 
				
			||||
 | 
					                                        help="Is student is present in the " | 
				
			||||
 | 
					                                             "morning") | 
				
			||||
 | 
					    is_present_afternoon = fields.Boolean(string='After Noon', | 
				
			||||
 | 
					                                          help="Is student is present in " | 
				
			||||
 | 
					                                               "the afternoon") | 
				
			||||
 | 
					    full_day_absent = fields.Integer(string='Full Day', | 
				
			||||
 | 
					                                     help="Is student full day absent or not ") | 
				
			||||
 | 
					    half_day_absent = fields.Integer(string='Half Day', | 
				
			||||
 | 
					                                     help="Is student half day absent or not ") | 
				
			||||
 | 
					    batch_id = fields.Many2one('university.batch', string="Batch", | 
				
			||||
 | 
					                               required=True, | 
				
			||||
 | 
					                               help="Select batch for the attendance") | 
				
			||||
 | 
					    date = fields.Date(string='Date', required=True, help="Attendance date") | 
				
			||||
@ -0,0 +1,60 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import api, fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class UniversityBatch(models.Model): | 
				
			||||
 | 
					    """For managing batches of every department in the university""" | 
				
			||||
 | 
					    _name = 'university.batch' | 
				
			||||
 | 
					    _inherit = ['mail.thread', 'mail.activity.mixin'] | 
				
			||||
 | 
					    _description = "University Batches" | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @api.model | 
				
			||||
 | 
					    def create(self, vals): | 
				
			||||
 | 
					        """Return the name as a str of semester + academic year""" | 
				
			||||
 | 
					        semester_id = self.env['university.semester'].browse( | 
				
			||||
 | 
					            vals['semester_id']) | 
				
			||||
 | 
					        academic_year_id = self.env['university.academic.year'].browse( | 
				
			||||
 | 
					            vals['academic_year_id']) | 
				
			||||
 | 
					        name = str(semester_id.name + ' - ' + academic_year_id.name) | 
				
			||||
 | 
					        vals['name'] = name | 
				
			||||
 | 
					        return super(UniversityBatch, self).create(vals) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    name = fields.Char(string="Name", help="Name of the Batch", readonly=True) | 
				
			||||
 | 
					    semester_id = fields.Many2one('university.semester', | 
				
			||||
 | 
					                                  string="Semester", required=True, | 
				
			||||
 | 
					                                  help="Select the semester") | 
				
			||||
 | 
					    department_id = fields.Many2one(related='semester_id.department_id', | 
				
			||||
 | 
					                                    string="Department", | 
				
			||||
 | 
					                                    help="In which department this " | 
				
			||||
 | 
					                                         "batch belongs to") | 
				
			||||
 | 
					    academic_year_id = fields.Many2one('university.academic.year', | 
				
			||||
 | 
					                                       string="Academic Year", required=True, | 
				
			||||
 | 
					                                       help="Select the academic year") | 
				
			||||
 | 
					    batch_strength = fields.Integer(string='Batch Strength', | 
				
			||||
 | 
					                                    help="Total strength of the batch") | 
				
			||||
 | 
					    faculty_id = fields.Many2one('university.faculty', | 
				
			||||
 | 
					                                 string='Faculty', help="Batch tutor/Faculty") | 
				
			||||
 | 
					    batch_student_ids = fields.One2many('university.student', | 
				
			||||
 | 
					                                        'batch_id', | 
				
			||||
 | 
					                                        string="Students", | 
				
			||||
 | 
					                                        help="Students of this Batch") | 
				
			||||
@ -0,0 +1,36 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class UniversityCourse(models.Model): | 
				
			||||
 | 
					    """Used to managing the courses of university""" | 
				
			||||
 | 
					    _name = 'university.course' | 
				
			||||
 | 
					    _description = "University Courses" | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    name = fields.Char(string="Name", required=True, help="Name of the course") | 
				
			||||
 | 
					    category = fields.Selection( | 
				
			||||
 | 
					        [('ug', 'Under Graduation'), ('pg', 'Post Graduation'), | 
				
			||||
 | 
					         ('diploma', 'Diploma')], string="Course Category", required=True, | 
				
			||||
 | 
					        help="In which category the course belong") | 
				
			||||
 | 
					    no_semester = fields.Integer(string="No.of Semester", | 
				
			||||
 | 
					                                 help="No.of semesters in each course") | 
				
			||||
@ -0,0 +1,42 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import api,fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class UniversityDepartment(models.Model): | 
				
			||||
 | 
					    """Used to manage department of every courses""" | 
				
			||||
 | 
					    _name = 'university.department' | 
				
			||||
 | 
					    _inherit = ['mail.thread', 'mail.activity.mixin'] | 
				
			||||
 | 
					    _description = "University Department" | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    name = fields.Char(string="Name", help="Name of the course") | 
				
			||||
 | 
					    code = fields.Char(string="Code", help="Code of the course", required=True) | 
				
			||||
 | 
					    course_id = fields.Many2one('university.course', | 
				
			||||
 | 
					                                string="Course", required=True, | 
				
			||||
 | 
					                                help="In what course the department belongs") | 
				
			||||
 | 
					    semester_ids = fields.One2many('university.semester', | 
				
			||||
 | 
					                                   'department_id', | 
				
			||||
 | 
					                                   string="Semester", readonly=True, | 
				
			||||
 | 
					                                   help="List of semesters under every course") | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def get_departments(self,course): | 
				
			||||
 | 
					        return self.search([('course_id', '=',course)]) | 
				
			||||
@ -0,0 +1,97 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import api, fields, models, _ | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class UniversityDocuments(models.Model): | 
				
			||||
 | 
					    """For managing the student document verification details""" | 
				
			||||
 | 
					    _name = 'university.document' | 
				
			||||
 | 
					    _inherit = ['mail.thread', 'mail.activity.mixin'] | 
				
			||||
 | 
					    _description = "Students Documents" | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    name = fields.Char(string="Reference No.", copy=False, | 
				
			||||
 | 
					                       help="Sequence of the document", | 
				
			||||
 | 
					                       default=lambda self: _('New')) | 
				
			||||
 | 
					    document_type_id = fields.Many2one('university.document.type', | 
				
			||||
 | 
					                                       string="Document Type", required=True, | 
				
			||||
 | 
					                                       help="Choose the type of document") | 
				
			||||
 | 
					    application_ref_id = fields.Many2one('university.application', | 
				
			||||
 | 
					                                         string="Application Ref.", | 
				
			||||
 | 
					                                         help="Application reference of " | 
				
			||||
 | 
					                                              "document") | 
				
			||||
 | 
					    description = fields.Text(string='Description', | 
				
			||||
 | 
					                              help="Enter a description about the document") | 
				
			||||
 | 
					    verified_date = fields.Date(string="Verified Date", | 
				
			||||
 | 
					                                help="Date at the verification is done") | 
				
			||||
 | 
					    verified_by_id = fields.Many2one('res.users', | 
				
			||||
 | 
					                                     string='Verified by', | 
				
			||||
 | 
					                                     help="Document Verified user") | 
				
			||||
 | 
					    responsible_verified_id = fields.Many2one('hr.employee', | 
				
			||||
 | 
					                                              string="Responsible", | 
				
			||||
 | 
					                                              help="Responsible person for " | 
				
			||||
 | 
					                                                   "verification") | 
				
			||||
 | 
					    attachment_ids = fields.Many2many( | 
				
			||||
 | 
					        'ir.attachment', 'university_attach_rel', | 
				
			||||
 | 
					        'doc_id', 'doc_attach_id', | 
				
			||||
 | 
					        string="Attachment", required=True, | 
				
			||||
 | 
					        help='You can attach the copy of your document', | 
				
			||||
 | 
					        copy=False) | 
				
			||||
 | 
					    state = fields.Selection( | 
				
			||||
 | 
					        [('draft', 'Draft'), ('correction', 'Correction'), | 
				
			||||
 | 
					         ('done', 'Done')], string='State', required=True, default='draft', | 
				
			||||
 | 
					        help="Status of document", track_visibility='onchange') | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @api.model | 
				
			||||
 | 
					    def create(self, vals): | 
				
			||||
 | 
					        """ This method overrides the create method to assign a sequence to | 
				
			||||
 | 
					            newly created records. | 
				
			||||
 | 
					           :param vals (dict): Dictionary containing the field values | 
				
			||||
 | 
					                               for the new university document record. | 
				
			||||
 | 
					           :returns class:`~university.documents`: The created university | 
				
			||||
 | 
					                                                   document record. | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        if vals.get('name', _('New')) == _('New'): | 
				
			||||
 | 
					            vals['name'] = self.env['ir.sequence'].next_by_code( | 
				
			||||
 | 
					                'university.document') or _('New') | 
				
			||||
 | 
					        res = super(UniversityDocuments, self).create(vals) | 
				
			||||
 | 
					        return res | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def action_verify_document(self): | 
				
			||||
 | 
					        """ This method updates the state of the university document to 'done' | 
				
			||||
 | 
					            if the documents are deemed perfect. | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        for rec in self: | 
				
			||||
 | 
					            rec.write({ | 
				
			||||
 | 
					                'verified_by_id': self.env.uid, | 
				
			||||
 | 
					                'verified_date': fields.Datetime.now().strftime("%Y-%m-%d"), | 
				
			||||
 | 
					                'state': 'done' | 
				
			||||
 | 
					            }) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def action_need_correction(self): | 
				
			||||
 | 
					        """ This method updates the state of the university document to | 
				
			||||
 | 
					            'correction' if the documents are deemed not perfect and | 
				
			||||
 | 
					            require correction. | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        for rec in self: | 
				
			||||
 | 
					            rec.write({ | 
				
			||||
 | 
					                'state': 'correction' | 
				
			||||
 | 
					            }) | 
				
			||||
@ -0,0 +1,33 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class UniversityDocumentType(models.Model): | 
				
			||||
 | 
					    """For managing document types in the document""" | 
				
			||||
 | 
					    _name = 'university.document.type' | 
				
			||||
 | 
					    _inherit = ['mail.thread', 'mail.activity.mixin'] | 
				
			||||
 | 
					    _description = "University Document Type" | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    name = fields.Char(string="Name", help="Name of the document type") | 
				
			||||
 | 
					    description = fields.Char(string="Description", | 
				
			||||
 | 
					                              help="Description about type") | 
				
			||||
@ -0,0 +1,92 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import api, fields, models, _ | 
				
			||||
 | 
					from odoo.exceptions import UserError, ValidationError | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class UniversityExam(models.Model): | 
				
			||||
 | 
					    """Used to manage student exams of every semester""" | 
				
			||||
 | 
					    _name = 'university.exam' | 
				
			||||
 | 
					    _inherit = ['mail.thread', 'mail.activity.mixin'] | 
				
			||||
 | 
					    _description = "University Student Exam management" | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    name = fields.Char(string='Name', default='New', help="Name of the exam") | 
				
			||||
 | 
					    batch_id = fields.Many2one('university.batch', string='Batch', | 
				
			||||
 | 
					                               help="Which batch's exam is") | 
				
			||||
 | 
					    exam_type_id = fields.Many2one('university.exam.type', | 
				
			||||
 | 
					                                   string='Type', help="Type of exam", | 
				
			||||
 | 
					                                   required=True) | 
				
			||||
 | 
					    start_date = fields.Date(string='Start Date', required=True, | 
				
			||||
 | 
					                             help="Enter start date of the exam") | 
				
			||||
 | 
					    end_date = fields.Date(string='End Date', required=True, | 
				
			||||
 | 
					                           help="Enter end date of the exam") | 
				
			||||
 | 
					    subject_line_ids = fields.One2many('exam.subject.line', | 
				
			||||
 | 
					                                       'exam_id', string='Subjects', | 
				
			||||
 | 
					                                       help="Subjects of the exam") | 
				
			||||
 | 
					    state = fields.Selection( | 
				
			||||
 | 
					        [('draft', 'Draft'), | 
				
			||||
 | 
					         ('ongoing', 'On Going'), | 
				
			||||
 | 
					         ('close', 'Closed'), | 
				
			||||
 | 
					         ('cancel', 'Canceled')], | 
				
			||||
 | 
					        default='draft', help="Status of the exam") | 
				
			||||
 | 
					    academic_year_id = fields.Many2one(related='batch_id.academic_year_id', | 
				
			||||
 | 
					                                       string='Academic Year', | 
				
			||||
 | 
					                                       help="Academic year of batch") | 
				
			||||
 | 
					    company_id = fields.Many2one( | 
				
			||||
 | 
					        'res.company', string='Company', help="Company of the exam", | 
				
			||||
 | 
					        default=lambda self: self.env.company) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @api.constrains('start_date', 'end_date') | 
				
			||||
 | 
					    def check_dates(self): | 
				
			||||
 | 
					        """ This constraint method validates that the start date of the exam is | 
				
			||||
 | 
					             earlier than the end date. | 
				
			||||
 | 
					            :raises ValidationError: If the start date is greater than the | 
				
			||||
 | 
					                                     end date | 
				
			||||
 | 
					       """ | 
				
			||||
 | 
					        for rec in self: | 
				
			||||
 | 
					            if rec.start_date > rec.end_date: | 
				
			||||
 | 
					                raise ValidationError( | 
				
			||||
 | 
					                    _("Start date must be Anterior to end date")) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def action_close_exam(self): | 
				
			||||
 | 
					        """ This method sets the state of the exam to 'close', | 
				
			||||
 | 
					            indicating that the exam has been closed. | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        self.state = 'close' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def action_cancel_exam(self): | 
				
			||||
 | 
					        """ This method sets the state of the exam to 'cancel', | 
				
			||||
 | 
					            indicating that the exam has been canceled. | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        self.state = 'cancel' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def action_confirm_exam(self): | 
				
			||||
 | 
					        """ This method confirms the exam and checks if at least | 
				
			||||
 | 
					            one subject is added to the exam. | 
				
			||||
 | 
					            :raises UserError: If no subjects are added to the exam. | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        if len(self.subject_line_ids) < 1: | 
				
			||||
 | 
					            raise UserError(_('Please Add Subjects')) | 
				
			||||
 | 
					        self.name = str(self.exam_type_id.name) + '/' + str(self.start_date)[ | 
				
			||||
 | 
					                                                        0:10] + ' (' + str( | 
				
			||||
 | 
					            self.batch_id.name) + ')' | 
				
			||||
 | 
					        self.state = 'ongoing' | 
				
			||||
@ -0,0 +1,40 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class UniversityExamType(models.Model): | 
				
			||||
 | 
					    """For managing type of exams such as internal or semester""" | 
				
			||||
 | 
					    _name = 'university.exam.type' | 
				
			||||
 | 
					    _inherit = ['mail.thread', 'mail.activity.mixin'] | 
				
			||||
 | 
					    _description = 'University Exam Type' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    name = fields.Char(string='Name', required=True, | 
				
			||||
 | 
					                       help="Name of the exam type") | 
				
			||||
 | 
					    exam_type = fields.Selection( | 
				
			||||
 | 
					        [('internal', 'Internal'), ('sem', 'Semester')], | 
				
			||||
 | 
					        string='Exam Type', default='internal', | 
				
			||||
 | 
					        help="Select exam type for exams") | 
				
			||||
 | 
					    company_id = fields.Many2one( | 
				
			||||
 | 
					        'res.company', string='Company', help="Company of the " | 
				
			||||
 | 
					                                              "exam type", | 
				
			||||
 | 
					        default=lambda self: self.env.company) | 
				
			||||
@ -0,0 +1,78 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class UniversityFaculty(models.Model): | 
				
			||||
 | 
					    """For managing faculties of university""" | 
				
			||||
 | 
					    _name = 'university.faculty' | 
				
			||||
 | 
					    _inherit = ['mail.thread', 'mail.activity.mixin'] | 
				
			||||
 | 
					    _description = "University Faculty records" | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    name = fields.Char(string='Name', required=True, | 
				
			||||
 | 
					                       help="Enter the first name") | 
				
			||||
 | 
					    last_name = fields.Char(string='Last Name', help="Enter the last name") | 
				
			||||
 | 
					    image = fields.Binary(string="Image", attachment=True, | 
				
			||||
 | 
					                          help="Image of the faculty") | 
				
			||||
 | 
					    date_of_birth = fields.Date(string="Date of Birth", required=True, | 
				
			||||
 | 
					                                help="Enter the DOB") | 
				
			||||
 | 
					    email = fields.Char(string="Email", required=True, | 
				
			||||
 | 
					                        help="Enter the Email for contact purpose") | 
				
			||||
 | 
					    phone = fields.Char(string="Phone", | 
				
			||||
 | 
					                        help="Enter the Phone for contact purpose") | 
				
			||||
 | 
					    mobile = fields.Char(string="Mobile", required=True, | 
				
			||||
 | 
					                         help="Enter the Mobile for contact purpose") | 
				
			||||
 | 
					    guardian_id = fields.Char(string="Guardian", help="Your guardian is ") | 
				
			||||
 | 
					    father_name = fields.Char(string="Father", help="Your Father name is ") | 
				
			||||
 | 
					    mother_name = fields.Char(string="Mother", help="Your Mother name is ") | 
				
			||||
 | 
					    degree_id = fields.Many2one('hr.recruitment.degree', | 
				
			||||
 | 
					                                string="Degree", | 
				
			||||
 | 
					                                Help="Select your Highest degree") | 
				
			||||
 | 
					    subject_line_ids = fields.Many2many('university.subject', | 
				
			||||
 | 
					                                        string='Subject Lines', | 
				
			||||
 | 
					                                        help="Subjects of Faculty") | 
				
			||||
 | 
					    employee_id = fields.Many2one('hr.employee', | 
				
			||||
 | 
					                                  string="Related Employee", | 
				
			||||
 | 
					                                  help="Related employee of faculty") | 
				
			||||
 | 
					    gender = fields.Selection( | 
				
			||||
 | 
					        [('male', 'Male'), ('female', 'Female'), ('other', 'Other')], | 
				
			||||
 | 
					        string='Gender', required=True, default='male', | 
				
			||||
 | 
					        help="Gender of the faculty", | 
				
			||||
 | 
					        track_visibility='onchange') | 
				
			||||
 | 
					    blood_group = fields.Selection( | 
				
			||||
 | 
					        [('a+', 'A+'), ('a-', 'A-'), ('b+', 'B+'), ('o+', 'O+'), | 
				
			||||
 | 
					         ('o-', 'O-'), ('ab-', 'AB-'), ('ab+', 'AB+')], | 
				
			||||
 | 
					        string='Blood Group', required=True, default='a+', | 
				
			||||
 | 
					        help="Blood group of faculty", track_visibility='onchange') | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def action_create_employee(self): | 
				
			||||
 | 
					        """Creating the employee for the faculty""" | 
				
			||||
 | 
					        for rec in self: | 
				
			||||
 | 
					            emp_id = self.env['hr.employee'].create({ | 
				
			||||
 | 
					                'name': rec.name + ' ' + rec.last_name, | 
				
			||||
 | 
					                'gender': rec.gender, | 
				
			||||
 | 
					                'birthday': rec.date_of_birth, | 
				
			||||
 | 
					                'image_1920': rec.image, | 
				
			||||
 | 
					                'work_phone': rec.phone, | 
				
			||||
 | 
					                'work_email': rec.email, | 
				
			||||
 | 
					            }) | 
				
			||||
 | 
					            rec.employee_id = emp_id.id | 
				
			||||
@ -0,0 +1,59 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import api, fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class UniversitySemester(models.Model): | 
				
			||||
 | 
					    """Used to manage the semester of department""" | 
				
			||||
 | 
					    _name = 'university.semester' | 
				
			||||
 | 
					    _inherit = ['mail.thread', 'mail.activity.mixin'] | 
				
			||||
 | 
					    _description = "University Semester" | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @api.model | 
				
			||||
 | 
					    def create(self, vals): | 
				
			||||
 | 
					        """ This method overrides the create method to generate the name for | 
				
			||||
 | 
					            the semester based on the department code and semester number. | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					            :param vals (dict): Dictionary containing the field values for the | 
				
			||||
 | 
					                                new university semester record. | 
				
			||||
 | 
					            :returns class:`~university.semester`: The created university | 
				
			||||
 | 
					                            semester record. | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        department_id = self.env['university.department'].browse( | 
				
			||||
 | 
					            vals['department_id']) | 
				
			||||
 | 
					        name = str(department_id.code) + '/Sem ' + str(vals['semester_no']) | 
				
			||||
 | 
					        vals['name'] = name | 
				
			||||
 | 
					        return super(UniversitySemester, self).create(vals) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    name = fields.Char(string="Name", help="Name of the semester", | 
				
			||||
 | 
					                       readonly=True) | 
				
			||||
 | 
					    semester_no = fields.Integer(string="Semester", help="Semester number", | 
				
			||||
 | 
					                                 required=True) | 
				
			||||
 | 
					    department_id = fields.Many2one('university.department', | 
				
			||||
 | 
					                                    string="Department", | 
				
			||||
 | 
					                                    required=True, | 
				
			||||
 | 
					                                    help="In which department the semester " | 
				
			||||
 | 
					                                         "belongs to") | 
				
			||||
 | 
					    syllabus_ids = fields.One2many('university.syllabus', | 
				
			||||
 | 
					                                   'semester_id', | 
				
			||||
 | 
					                                   readonly=1, help="Syllabus of semester", | 
				
			||||
 | 
					                                   string="Syllabus") | 
				
			||||
@ -0,0 +1,148 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import api, fields, models, _ | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class UniversityStudent(models.Model): | 
				
			||||
 | 
					    """To keep records of university student details""" | 
				
			||||
 | 
					    _name = 'university.student' | 
				
			||||
 | 
					    _inherit = ['mail.thread', 'mail.activity.mixin'] | 
				
			||||
 | 
					    _inherits = {'res.partner': 'partner_id'} | 
				
			||||
 | 
					    _description = 'University student records' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @api.model | 
				
			||||
 | 
					    def create(self, vals): | 
				
			||||
 | 
					        """ This method overrides the create method to assign a sequence number | 
				
			||||
 | 
					            to the newly created record. | 
				
			||||
 | 
					           :param vals (dict): Dictionary containing the field values for the | 
				
			||||
 | 
					                                new university student record. | 
				
			||||
 | 
					           :returns class: university.student The created university student | 
				
			||||
 | 
					                            record. | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        vals['admission_no'] = self.env['ir.sequence'].next_by_code( | 
				
			||||
 | 
					            'university.student') | 
				
			||||
 | 
					        res = super(UniversityStudent, self).create(vals) | 
				
			||||
 | 
					        return res | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    partner_id = fields.Many2one( | 
				
			||||
 | 
					        'res.partner', string='Partner', help="Student Partner", | 
				
			||||
 | 
					        required=True, ondelete="cascade") | 
				
			||||
 | 
					    middle_name = fields.Char(string='Middle Name', | 
				
			||||
 | 
					                              help="Middle Name of the student") | 
				
			||||
 | 
					    last_name = fields.Char(string='Last Name', help="Last name of student") | 
				
			||||
 | 
					    application_no = fields.Char(string="Application No", | 
				
			||||
 | 
					                                 help="Application number of the student") | 
				
			||||
 | 
					    date_of_birth = fields.Date(string="Date of Birth", requird=True, | 
				
			||||
 | 
					                                help="Date of Birth details") | 
				
			||||
 | 
					    guardian_id = fields.Many2one('res.partner', string="Guardian", | 
				
			||||
 | 
					                                  help="Student guardian details", | 
				
			||||
 | 
					                                  domain=[('is_parent', '=', True)]) | 
				
			||||
 | 
					    father_name = fields.Char(string="Father", help="Student father details") | 
				
			||||
 | 
					    mother_name = fields.Char(string="Mother", help="Student mother details") | 
				
			||||
 | 
					    semester_id = fields.Many2one('university.semester', | 
				
			||||
 | 
					                                  string="Semester", | 
				
			||||
 | 
					                                  help="Which semester of student is") | 
				
			||||
 | 
					    department_id = fields.Many2one(related='semester_id.department_id', | 
				
			||||
 | 
					                                    help="Which department in semester", | 
				
			||||
 | 
					                                    string="Department") | 
				
			||||
 | 
					    course_id = fields.Many2one(related='department_id.course_id', | 
				
			||||
 | 
					                                help="Which course in the department", | 
				
			||||
 | 
					                                string="Course") | 
				
			||||
 | 
					    admission_no = fields.Char(string="Admission Number", readonly=True, | 
				
			||||
 | 
					                               help="Admission no. of the student ") | 
				
			||||
 | 
					    gender = fields.Selection([('male', 'Male'), | 
				
			||||
 | 
					                               ('female', 'Female'), | 
				
			||||
 | 
					                               ('other', 'Other')], | 
				
			||||
 | 
					                              help="Student gender details", | 
				
			||||
 | 
					                              string='Gender', required=True, default='male', | 
				
			||||
 | 
					                              track_visibility='onchange') | 
				
			||||
 | 
					    blood_group = fields.Selection([('a+', 'A+'), | 
				
			||||
 | 
					                                    ('a-', 'A-'), | 
				
			||||
 | 
					                                    ('b+', 'B+'), | 
				
			||||
 | 
					                                    ('o+', 'O+'), | 
				
			||||
 | 
					                                    ('o-', 'O-'), | 
				
			||||
 | 
					                                    ('ab-', 'AB-'), | 
				
			||||
 | 
					                                    ('ab+', 'AB+')], | 
				
			||||
 | 
					                                   string='Blood Group', required=True, | 
				
			||||
 | 
					                                   help="Student blood group details", | 
				
			||||
 | 
					                                   default='a+', | 
				
			||||
 | 
					                                   track_visibility='onchange') | 
				
			||||
 | 
					    company_id = fields.Many2one('res.company', string='Company', | 
				
			||||
 | 
					                                 help="Company") | 
				
			||||
 | 
					    per_street = fields.Char(string="Street", help="Street Address") | 
				
			||||
 | 
					    per_street2 = fields.Char(string="Street2", help="Street2 address") | 
				
			||||
 | 
					    per_zip = fields.Char(change_default=True, string="Zip", | 
				
			||||
 | 
					                          help="Zip/Pincode details") | 
				
			||||
 | 
					    per_city = fields.Char(string="City", help="Student living city") | 
				
			||||
 | 
					    per_state_id = fields.Many2one("res.country.state", | 
				
			||||
 | 
					                                   string='State',help="State", | 
				
			||||
 | 
					                                   ondelete='restrict') | 
				
			||||
 | 
					    per_country_id = fields.Many2one('res.country', | 
				
			||||
 | 
					                                     string='Country', | 
				
			||||
 | 
					                                     help="Nationality of student", | 
				
			||||
 | 
					                                     ondelete='restrict') | 
				
			||||
 | 
					    mother_tongue = fields.Char(string="Mother Tongue", | 
				
			||||
 | 
					                                help="Student mother tongue") | 
				
			||||
 | 
					    caste = fields.Char(string="Caste", | 
				
			||||
 | 
					                               help="Student caste details") | 
				
			||||
 | 
					    religion = fields.Char(string="Religion", | 
				
			||||
 | 
					                                  help="Student religion details") | 
				
			||||
 | 
					    is_same_address = fields.Boolean(string="Is same Address?", | 
				
			||||
 | 
					                                     help="Enable if student have single " | 
				
			||||
 | 
					                                          "address") | 
				
			||||
 | 
					    nationality_id = fields.Many2one('res.country', | 
				
			||||
 | 
					                                     string='Nationality', | 
				
			||||
 | 
					                                     help="Nationality of student", | 
				
			||||
 | 
					                                     ondelete='restrict') | 
				
			||||
 | 
					    application_id = fields.Many2one('university.application', | 
				
			||||
 | 
					                                     help="Application no of student", | 
				
			||||
 | 
					                                     string="Application No") | 
				
			||||
 | 
					    user_id = fields.Many2one('res.users', string="User", | 
				
			||||
 | 
					                              readonly=True, | 
				
			||||
 | 
					                              help="Related User of the student") | 
				
			||||
 | 
					    batch_id = fields.Many2one('university.batch', string="Batch", | 
				
			||||
 | 
					                               help="Relation to batches of university") | 
				
			||||
 | 
					    academic_year_id = fields.Many2one('university.academic.year', | 
				
			||||
 | 
					                                       string="Academic Year", | 
				
			||||
 | 
					                                       help="Academic year of the student") | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def action_student_documents(self): | 
				
			||||
 | 
					        """ Open the documents submitted by the student along with the admission | 
				
			||||
 | 
					            application. This method retrieves the documents associated with | 
				
			||||
 | 
					            the admission application linked to the current student record. | 
				
			||||
 | 
					            :returns dict: A dictionary defining the action to open the | 
				
			||||
 | 
					                            'university.document' records. | 
				
			||||
 | 
					       """ | 
				
			||||
 | 
					        self.ensure_one() | 
				
			||||
 | 
					        if self.application_id.id: | 
				
			||||
 | 
					            documents_list = self.env['university.document'].search( | 
				
			||||
 | 
					                [('application_ref_id', '=', self.application_id.id)]).mapped( | 
				
			||||
 | 
					                'id') | 
				
			||||
 | 
					            return { | 
				
			||||
 | 
					                'domain': [('id', 'in', documents_list)], | 
				
			||||
 | 
					                'name': _('Documents'), | 
				
			||||
 | 
					                'view_mode': 'tree,form', | 
				
			||||
 | 
					                'res_model': 'university.document', | 
				
			||||
 | 
					                'view_id': False, | 
				
			||||
 | 
					                'context': {'application_ref_id': self.application_id.id}, | 
				
			||||
 | 
					                'type': 'ir.actions.act_window' | 
				
			||||
 | 
					            } | 
				
			||||
@ -0,0 +1,43 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class UniversitySubject(models.Model): | 
				
			||||
 | 
					    """For managing subjects of every courses""" | 
				
			||||
 | 
					    _name = 'university.subject' | 
				
			||||
 | 
					    _inherit = ['mail.thread', 'mail.activity.mixin'] | 
				
			||||
 | 
					    _description = "University Subjects" | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    name = fields.Char(string="Subject", help="Name of the subject") | 
				
			||||
 | 
					    is_language = fields.Boolean(string="Language", | 
				
			||||
 | 
					                                 help="Tick if this subject is a language") | 
				
			||||
 | 
					    is_lab = fields.Boolean(string="Lab", help="Tick if this subject is a Lab") | 
				
			||||
 | 
					    code = fields.Char(string="Code", help="Enter the Subject Code") | 
				
			||||
 | 
					    type = fields.Selection( | 
				
			||||
 | 
					        [('compulsory', 'Compulsory'), ('elective', 'Elective')], | 
				
			||||
 | 
					        string='Type', default="compulsory", | 
				
			||||
 | 
					        help="Choose the type of the subject") | 
				
			||||
 | 
					    weightage = fields.Float(string='Weightage', default=1.0, | 
				
			||||
 | 
					                             help="Enter the weightage for this subject") | 
				
			||||
 | 
					    description = fields.Text(string='Description', | 
				
			||||
 | 
					                              help="Description about the subject") | 
				
			||||
@ -0,0 +1,67 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import api, fields, models | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class UniversitySyllabus(models.Model): | 
				
			||||
 | 
					    """Manages the syllabus of department""" | 
				
			||||
 | 
					    _name = 'university.syllabus' | 
				
			||||
 | 
					    _inherit = ['mail.thread', 'mail.activity.mixin'] | 
				
			||||
 | 
					    _description = "University Syllabus" | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @api.model | 
				
			||||
 | 
					    def create(self, vals): | 
				
			||||
 | 
					        """ This method overrides the create method to generate the name for the | 
				
			||||
 | 
					            syllabus based on the department and subject. | 
				
			||||
 | 
					           :param vals (dict): Dictionary containing the field values for the | 
				
			||||
 | 
					                              new university syllabus record. | 
				
			||||
 | 
					           :returns class:`university.syllabus` The created university | 
				
			||||
 | 
					                                                    syllabus record. | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        """Return the name as a str of course code + subject code""" | 
				
			||||
 | 
					        semester_id = self.env['university.semester'].browse( | 
				
			||||
 | 
					            vals['semester_id']) | 
				
			||||
 | 
					        subject_id = self.env['university.subject'].browse( | 
				
			||||
 | 
					            vals['subject_id']) | 
				
			||||
 | 
					        name = str(semester_id.name) + '/' + str( | 
				
			||||
 | 
					            subject_id.code) + '-Syllabus' | 
				
			||||
 | 
					        vals['name'] = name | 
				
			||||
 | 
					        return super(UniversitySyllabus, self).create(vals) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    name = fields.Char(string="Name", help="Syllabus name", readonly=True) | 
				
			||||
 | 
					    subject_id = fields.Many2one('university.subject', | 
				
			||||
 | 
					                                 required=True, string="Subject", | 
				
			||||
 | 
					                                 help="Select subject for syllabus") | 
				
			||||
 | 
					    total_hrs = fields.Float(string="Total Hrs", | 
				
			||||
 | 
					                             help="Time for completing subjects") | 
				
			||||
 | 
					    description = fields.Text(string='Module Details', | 
				
			||||
 | 
					                              help="Description about modules") | 
				
			||||
 | 
					    subject_code = fields.Char(related='subject_id.code', string="Code", | 
				
			||||
 | 
					                               help="Subject code of selected subject") | 
				
			||||
 | 
					    subject_weightage = fields.Float(related='subject_id.weightage', | 
				
			||||
 | 
					                                     help="Points of the subject") | 
				
			||||
 | 
					    semester_id = fields.Many2one('university.semester', | 
				
			||||
 | 
					                                  string="Semester", required=True, | 
				
			||||
 | 
					                                  help="Select semester for syllabus") | 
				
			||||
 | 
					    department_id = fields.Many2one(related='semester_id.department_id', | 
				
			||||
 | 
					                                    string="Department", | 
				
			||||
 | 
					                                    help="Select department for syllabus") | 
				
			||||
@ -0,0 +1,86 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Cybrosys Technologies Pvt. Ltd. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			||||
 | 
					#    Author: Raneesha M K (odoo@cybrosys.com) | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You can modify it under the terms of the GNU AFFERO | 
				
			||||
 | 
					#    GENERAL PUBLIC LICENSE (AGPL v3), Version 3. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    This program is distributed in the hope that it will be useful, | 
				
			||||
 | 
					#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			||||
 | 
					#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			||||
 | 
					#    GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					#    You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE | 
				
			||||
 | 
					#    (AGPL v3) along with this program. | 
				
			||||
 | 
					#    If not, see <http://www.gnu.org/licenses/>. | 
				
			||||
 | 
					# | 
				
			||||
 | 
					############################################################################### | 
				
			||||
 | 
					from odoo import api, fields, models, _ | 
				
			||||
 | 
					from odoo.exceptions import ValidationError | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class UniversityTimeTable(models.Model): | 
				
			||||
 | 
					    """Manages the timetable of every batch""" | 
				
			||||
 | 
					    _name = 'university.timetable' | 
				
			||||
 | 
					    _inherit = ['mail.thread', 'mail.activity.mixin'] | 
				
			||||
 | 
					    _description = 'Timetable' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    name = fields.Char(string="Name", compute="_compute_name", | 
				
			||||
 | 
					                       help="Name of the timetable") | 
				
			||||
 | 
					    batch_id = fields.Many2one('university.batch', string='Batch', | 
				
			||||
 | 
					                               help="Batch of the timetable", | 
				
			||||
 | 
					                               required=True) | 
				
			||||
 | 
					    academic_year_id = fields.Many2one(related="batch_id.academic_year_id", | 
				
			||||
 | 
					                                       help="Batch academic year", | 
				
			||||
 | 
					                                       string='Academic Year') | 
				
			||||
 | 
					    mon_timetable_ids = fields.One2many('timetable.schedule.line', | 
				
			||||
 | 
					                                        'timetable_id', | 
				
			||||
 | 
					                                        help="Scheduled line of Monday", | 
				
			||||
 | 
					                                        domain=[('week_day', '=', '0')]) | 
				
			||||
 | 
					    tue_timetable_ids = fields.One2many('timetable.schedule.line', | 
				
			||||
 | 
					                                        'timetable_id', | 
				
			||||
 | 
					                                        help="Scheduled line of Tuesday", | 
				
			||||
 | 
					                                        domain=[('week_day', '=', '1')]) | 
				
			||||
 | 
					    wed_timetable_ids = fields.One2many('timetable.schedule.line', | 
				
			||||
 | 
					                                        'timetable_id', | 
				
			||||
 | 
					                                        help="Scheduled line of Wednesday", | 
				
			||||
 | 
					                                        domain=[('week_day', '=', '2')]) | 
				
			||||
 | 
					    thur_timetable_ids = fields.One2many('timetable.schedule.line', | 
				
			||||
 | 
					                                         'timetable_id', | 
				
			||||
 | 
					                                         help="Scheduled line of Thursday", | 
				
			||||
 | 
					                                         domain=[('week_day', '=', '3')]) | 
				
			||||
 | 
					    fri_timetable_ids = fields.One2many('timetable.schedule.line', | 
				
			||||
 | 
					                                        'timetable_id', | 
				
			||||
 | 
					                                        help="Scheduled line of Friday", | 
				
			||||
 | 
					                                        domain=[('week_day', '=', '4')]) | 
				
			||||
 | 
					    sat_timetable_ids = fields.One2many('timetable.schedule.line', | 
				
			||||
 | 
					                                        'timetable_id', | 
				
			||||
 | 
					                                        help="Scheduled line of Saturday", | 
				
			||||
 | 
					                                        domain=[('week_day', '=', '5')]) | 
				
			||||
 | 
					    company_id = fields.Many2one( | 
				
			||||
 | 
					        'res.company', string='Company', help="Company", | 
				
			||||
 | 
					        default=lambda self: self.env.company) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    def _compute_name(self): | 
				
			||||
 | 
					        """generate name for the timetable records""" | 
				
			||||
 | 
					        for rec in self: | 
				
			||||
 | 
					            rec.name = False | 
				
			||||
 | 
					            if rec.batch_id and rec.academic_year_id: | 
				
			||||
 | 
					                rec.name = "/".join([rec.batch_id.name, "Schedule"]) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @api.constrains('batch_id') | 
				
			||||
 | 
					    def _check_batch(self): | 
				
			||||
 | 
					        """ This method ensures that only one timetable can be scheduled for a | 
				
			||||
 | 
					            specific Batch. | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					            :raises: ValidationError if more than one timetable is already | 
				
			||||
 | 
					                    scheduled for the Batch. | 
				
			||||
 | 
					        """ | 
				
			||||
 | 
					        batches = self.search_count([('batch_id', '=', self.batch_id.id)]) | 
				
			||||
 | 
					        if batches > 1: | 
				
			||||
 | 
					            raise ValidationError(_('Timetable is already scheduled for ' | 
				
			||||
 | 
					                                    'this Batch')) | 
				
			||||
@ -0,0 +1,30 @@ | 
				
			|||||
 | 
					<?xml version="1.0" encoding="utf-8"?> | 
				
			||||
 | 
					<odoo> | 
				
			||||
 | 
					    <!--A New category for university education groups--> | 
				
			||||
 | 
					    <record model="ir.module.category" id="module_category_university"> | 
				
			||||
 | 
					        <field name="name">University</field> | 
				
			||||
 | 
					        <field name="description">Helps you to manage your institution</field> | 
				
			||||
 | 
					        <field name="sequence">5</field> | 
				
			||||
 | 
					    </record> | 
				
			||||
 | 
					    <!--Staff security group--> | 
				
			||||
 | 
					    <record id="education_university_management_group_faculty" model="res.groups"> | 
				
			||||
 | 
					        <field name="name">Staff</field> | 
				
			||||
 | 
					        <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/> | 
				
			||||
 | 
					        <field name="category_id" ref="module_category_university"/> | 
				
			||||
 | 
					    </record> | 
				
			||||
 | 
					    <!--HOD security group--> | 
				
			||||
 | 
					    <record id="education_university_management_group_hod" model="res.groups"> | 
				
			||||
 | 
					        <field name="name">Head Of Department</field> | 
				
			||||
 | 
					        <field name="implied_ids" | 
				
			||||
 | 
					               eval="[(4, ref('education_university_management_group_faculty'))]"/> | 
				
			||||
 | 
					        <field name="category_id" ref="module_category_university"/> | 
				
			||||
 | 
					    </record> | 
				
			||||
 | 
					    <!--Principal security group--> | 
				
			||||
 | 
					    <record id="education_university_management_group_principal" model="res.groups"> | 
				
			||||
 | 
					        <field name="name">Principal</field> | 
				
			||||
 | 
					        <field name="category_id" ref="module_category_university"/> | 
				
			||||
 | 
					        <field name="implied_ids" eval="[(4, ref('education_university_management_group_hod'))]"/> | 
				
			||||
 | 
					        <field name="users" | 
				
			||||
 | 
					               eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/> | 
				
			||||
 | 
					    </record> | 
				
			||||
 | 
					</odoo> | 
				
			||||
		
		
			
  | 
| 
		 After Width: | Height: | Size: 3.6 KiB  | 
| 
		 After Width: | Height: | Size: 310 B  | 
| 
		 After Width: | Height: | Size: 1.3 KiB  | 
| 
		 After Width: | Height: | Size: 1.4 KiB  | 
| 
		 After Width: | Height: | Size: 576 B  | 
| 
		 After Width: | Height: | Size: 733 B  | 
| 
		 After Width: | Height: | Size: 911 B  | 
| 
		 After Width: | Height: | Size: 1.1 KiB  | 
| 
		 After Width: | Height: | Size: 1.2 KiB  | 
| 
		 After Width: | Height: | Size: 673 B  | 
| 
		 After Width: | Height: | Size: 878 B  | 
| 
		 After Width: | Height: | Size: 653 B  | 
| 
		 After Width: | Height: | Size: 905 B  | 
| 
		 After Width: | Height: | Size: 839 B  | 
| 
		 After Width: | Height: | Size: 427 B  | 
| 
		 After Width: | Height: | Size: 627 B  | 
| 
		 After Width: | Height: | Size: 1.2 KiB  | 
| 
		 After Width: | Height: | Size: 988 B  | 
| 
		 After Width: | Height: | Size: 1.2 KiB  | 
| 
		 After Width: | Height: | Size: 1.5 KiB  | 
| 
		 After Width: | Height: | Size: 1.1 KiB  | 
| 
		 After Width: | Height: | Size: 1.9 KiB  | 
| 
		 After Width: | Height: | Size: 1.1 KiB  | 
| 
		 After Width: | Height: | Size: 2.1 KiB  | 
| 
		 After Width: | Height: | Size: 4.4 KiB  | 
| 
		 After Width: | Height: | Size: 589 B  | 
| 
		 After Width: | Height: | Size: 3.4 KiB  | 
| 
		 After Width: | Height: | Size: 1.7 KiB  | 
| 
		 After Width: | Height: | Size: 2.3 KiB  | 
| 
		 After Width: | Height: | Size: 967 B  | 
| 
		 After Width: | Height: | Size: 1.6 KiB  | 
| 
		 After Width: | Height: | Size: 3.8 KiB  | 
| 
		 After Width: | Height: | Size: 5.0 KiB  | 
| 
		 After Width: | Height: | Size: 128 KiB  | 
| 
		 After Width: | Height: | Size: 180 KiB  | 
| 
		 After Width: | Height: | Size: 83 KiB  | 
| 
		 After Width: | Height: | Size: 80 KiB  | 
| 
		 After Width: | Height: | Size: 80 KiB  | 
| 
		 After Width: | Height: | Size: 199 KiB  | 
| 
		 After Width: | Height: | Size: 114 KiB  | 
| 
		 After Width: | Height: | Size: 236 KiB  | 
| 
		 After Width: | Height: | Size: 100 KiB  | 
| 
		 After Width: | Height: | Size: 55 KiB  | 
| 
		 After Width: | Height: | Size: 109 KiB  | 
| 
		 After Width: | Height: | Size: 83 KiB  | 
| 
		 After Width: | Height: | Size: 71 KiB  | 
| 
		 After Width: | Height: | Size: 73 KiB  | 
| 
		 After Width: | Height: | Size: 89 KiB  | 
| 
		 After Width: | Height: | Size: 107 KiB  | 
| 
		 After Width: | Height: | Size: 89 KiB  | 
| 
		 After Width: | Height: | Size: 127 KiB  | 
| 
		 After Width: | Height: | Size: 101 KiB  | 
| 
		 After Width: | Height: | Size: 50 KiB  | 
| 
		 After Width: | Height: | Size: 14 KiB  |