diff --git a/__manifest__.py b/__manifest__.py index 2ffdbff..26e1899 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -1,11 +1,12 @@ { 'name': 'School_Management', 'version': '1.0', - 'depends': ['base', 'web', 'mail','product'], + 'depends': ['base', 'web', 'mail','product','hr'], 'license': 'LGPL-3', 'data': [ 'security/security.xml', 'security/ir.model.access.csv', + 'report/school_id_card_report.xml', 'views/schedule.xml', 'views/class.xml', 'views/subject.xml', @@ -23,7 +24,7 @@ 'views/school_student_views.xml', 'views/fee_structure_views.xml', 'views/fee_element_views.xml', - 'views/menu.xml', + 'views/menu.xml', ], 'installable': True, 'application': True, diff --git a/models/__pycache__/application.cpython-310.pyc b/models/__pycache__/application.cpython-310.pyc index e53371b..f0350a1 100644 Binary files a/models/__pycache__/application.cpython-310.pyc and b/models/__pycache__/application.cpython-310.pyc differ diff --git a/models/__pycache__/enrollment.cpython-310.pyc b/models/__pycache__/enrollment.cpython-310.pyc index f73d4b5..de63302 100644 Binary files a/models/__pycache__/enrollment.cpython-310.pyc and b/models/__pycache__/enrollment.cpython-310.pyc differ diff --git a/models/__pycache__/schedule.cpython-310.pyc b/models/__pycache__/schedule.cpython-310.pyc index 7e16979..26e5b4c 100644 Binary files a/models/__pycache__/schedule.cpython-310.pyc and b/models/__pycache__/schedule.cpython-310.pyc differ diff --git a/models/__pycache__/school_course.cpython-310.pyc b/models/__pycache__/school_course.cpython-310.pyc index 33b0f0d..0e7bf4b 100644 Binary files a/models/__pycache__/school_course.cpython-310.pyc and b/models/__pycache__/school_course.cpython-310.pyc differ diff --git a/models/__pycache__/school_course_assignment.cpython-310.pyc b/models/__pycache__/school_course_assignment.cpython-310.pyc index 2c280d1..b0b1988 100644 Binary files a/models/__pycache__/school_course_assignment.cpython-310.pyc and b/models/__pycache__/school_course_assignment.cpython-310.pyc differ diff --git a/models/__pycache__/school_course_schedule.cpython-310.pyc b/models/__pycache__/school_course_schedule.cpython-310.pyc index d9b0ae2..524770f 100644 Binary files a/models/__pycache__/school_course_schedule.cpython-310.pyc and b/models/__pycache__/school_course_schedule.cpython-310.pyc differ diff --git a/models/__pycache__/school_student.cpython-310.pyc b/models/__pycache__/school_student.cpython-310.pyc index e84bf7a..c8c2892 100644 Binary files a/models/__pycache__/school_student.cpython-310.pyc and b/models/__pycache__/school_student.cpython-310.pyc differ diff --git a/models/__pycache__/school_subject.cpython-310.pyc b/models/__pycache__/school_subject.cpython-310.pyc index 2dffe32..50eae0c 100644 Binary files a/models/__pycache__/school_subject.cpython-310.pyc and b/models/__pycache__/school_subject.cpython-310.pyc differ diff --git a/models/__pycache__/school_subject_lesson.cpython-310.pyc b/models/__pycache__/school_subject_lesson.cpython-310.pyc index 82a0bd7..b3950e1 100644 Binary files a/models/__pycache__/school_subject_lesson.cpython-310.pyc and b/models/__pycache__/school_subject_lesson.cpython-310.pyc differ diff --git a/models/__pycache__/school_subject_teacher_info.cpython-310.pyc b/models/__pycache__/school_subject_teacher_info.cpython-310.pyc index 1ae5d3b..38749b9 100644 Binary files a/models/__pycache__/school_subject_teacher_info.cpython-310.pyc and b/models/__pycache__/school_subject_teacher_info.cpython-310.pyc differ diff --git a/models/application.py b/models/application.py index c6819e5..7526c51 100644 --- a/models/application.py +++ b/models/application.py @@ -1,7 +1,6 @@ from odoo import models, fields, api from odoo.exceptions import ValidationError import re -from odoo.exceptions import UserError import base64 class SchoolApplication(models.Model): @@ -11,56 +10,54 @@ class SchoolApplication(models.Model): _rec_name = 'name' _inherit = ['mail.thread', 'mail.activity.mixin'] - name = fields.Char(string="Student Name", required=True,) - email = fields.Char(string="Email", ) - phone_no = fields.Char(string="Phone Number") - image = fields.Binary("Profile Photo", store=True) + # Link to res.partner + partner_id = fields.Many2one('res.partner', string="Student Contact", ondelete="cascade") + + # Basic Info + name = fields.Char(string="Student Name", required=True) + roll_no = fields.Char(string="Roll Number", readonly=False) + email = fields.Char(string="Email") + phone_no = fields.Char(string="Phone Number") + image = fields.Binary("Profile Photo", store=True) address = fields.Text(string="Address") + + # Class and Academic Info class_name = fields.Selection([ - ('1', 'Class 1'), - ('2', 'Class 2'), - ('3', 'Class 3'), - ('4', 'Class 4'), - ('5', 'Class 5'), - ('6', 'Class 6'), - ('7', 'Class 7'), - ('8', 'Class 8'), - ('9', 'Class 9'), - ('10', 'Class 10'), - ('11', 'Class 11'), - ('12', 'Class 12'), + ('1', 'Class 1'), ('2', 'Class 2'), ('3', 'Class 3'), + ('4', 'Class 4'), ('5', 'Class 5'), ('6', 'Class 6'), + ('7', 'Class 7'), ('8', 'Class 8'), ('9', 'Class 9'), + ('10', 'Class 10'), ('11', 'Class 11'), ('12', 'Class 12'), ], string="Class", required=True) - + academic_year = fields.Char(string="Academic Year") gender = fields.Selection([ - ('male', 'Male'), - ('female', 'Female'), - ('other', 'Other') + ('male', 'Male'), ('female', 'Female'), ('other', 'Other') ], string="Gender") + date_of_birth = fields.Date(string="Date of Birth") parent_email = fields.Char(string="Parent Email") + blood_group = fields.Selection([ - ('a+', 'A+'), ('a-', 'A-'), - ('b+', 'B+'), ('b-', 'B-'), - ('ab+', 'AB+'), ('ab-', 'AB-'), - ('o+', 'O+'), ('o-', 'O-') + ('a+', 'A+'), ('a-', 'A-'), ('b+', 'B+'), ('b-', 'B-'), + ('ab+', 'AB+'), ('ab-', 'AB-'), ('o+', 'O+'), ('o-', 'O-') ], string="Blood Group") + school_name = fields.Char(string="Previous School") has_disability = fields.Boolean(string="Any Disability") is_ex_service_child = fields.Boolean(string="Ex-Service Man's Child") + caste = fields.Selection([ - ('general', 'General'), - ('OBC', 'OBC'), - ('SC', 'SC'), - ('ST', 'ST'), - ('other','Other') + ('general', 'General'), ('OBC', 'OBC'), ('SC', 'SC'), + ('ST', 'ST'), ('other', 'Other') ], string="Caste") + status = fields.Selection([ ('pending', 'Pending'), ('approved', 'Approved'), ('rejected', 'Rejected') ], default='pending') + # Parent Info father_name = fields.Char(string="Father's Name") father_phone = fields.Char(string="Father's Phone") mother_name = fields.Char(string="Mother's Name") @@ -80,14 +77,21 @@ class SchoolApplication(models.Model): aadhaar_card = fields.Binary(string="Aadhaar Card") aadhaar_card_filename = fields.Char(string="Filename") - - + + @api.onchange('roll_no') + def _onchange_roll_no(self): + """Auto-generate roll number only when it's empty and user clicks the field.""" + if not self.roll_no: + self.roll_no = self.env['ir.sequence'].next_by_code('school.application') + + # Constraint on phone number @api.constrains('phone_no') def _check_phone_no(self): for record in self: - if not re.fullmatch(r'\d{10}', record.phone_no or ''): + if record.phone_no and not re.fullmatch(r'\d{10}', record.phone_no): raise ValidationError("Phone number must contain exactly 10 digits.") - + + # Show ID card action def action_show_id_card(self): self.ensure_one() return { @@ -97,22 +101,20 @@ class SchoolApplication(models.Model): 'res_model': 'school.application', 'res_id': self.id, 'view_id': self.env.ref('school_management.view_school_id_card_form').id, - 'target': 'new', # or 'current' for full page + 'target': 'new', } + # Optional: Sync partner details with application + @api.onchange('partner_id') + def _onchange_partner_id(self): + if self.partner_id: + self.name = self.partner_id.name + self.email = self.partner_id.email + self.phone_no = self.partner_id.phone + self.image = self.partner_id.image_1920 + self.address = self.partner_id.contact_address - @api.depends('application_id') - def _compute_student_id(self): - for rec in self: - rec.student_id = str(rec.application_id.id) if rec.application_id else '' + def print_id_card(self): + self.ensure_one() + return self.env.ref('school_management.report_school_id_card').report_action(self) - # def action_open_id_card_wizard(self): - # return { - # 'type': 'ir.actions.act_window', - # 'name': 'Generate ID Card', - # 'res_model': 'wizard.generate.id.card', - # 'view_mode': 'form', - # 'target': 'new', - # 'context': {'default_application_id': self.id}, - # } - \ No newline at end of file diff --git a/models/enrollment.py b/models/enrollment.py index 8d4e73a..d6780b5 100644 --- a/models/enrollment.py +++ b/models/enrollment.py @@ -1,58 +1,51 @@ from odoo import models, fields, api -_inherit = ['mail.thread', 'mail.activity.mixin'] - class SchoolEnrollment(models.Model): _name = 'school.enrollment' _description = 'Enrollment' - application_id = fields.Many2one('school.application', string="Student", required=True) + # Relations + application_id = fields.Many2one('school.application', string="Application", required=True) + student_id = fields.Many2one('res.partner', string='Student', required=True) school_id = fields.Many2one('res.company', string="School", default=lambda self: self.env.company) - student_id = fields.Char(string="Student ID", compute='_compute_student_id', store=True) - student_name = fields.Many2one('school.application', string="Student", ondelete='set null') + + # Basic Info image = fields.Binary("Profile Photo", store=True) class_name = fields.Selection([ - ('1', 'Class 1'), - ('2', 'Class 2'), - ('3', 'Class 3'), - ('4', 'Class 4'), - ('5', 'Class 5'), - ('6', 'Class 6'), - ('7', 'Class 7'), - ('8', 'Class 8'), - ('9', 'Class 9'), - ('10', 'Class 10'), - ('11', 'Class 11'), - ('12', 'Class 12'), + ('1', 'Class 1'), ('2', 'Class 2'), ('3', 'Class 3'), + ('4', 'Class 4'), ('5', 'Class 5'), ('6', 'Class 6'), + ('7', 'Class 7'), ('8', 'Class 8'), ('9', 'Class 9'), + ('10', 'Class 10'), ('11', 'Class 11'), ('12', 'Class 12'), ], string="Class", required=True) course = fields.Char(string="Course") session = fields.Char(string="Session") academic_year = fields.Char(string="Academic Year") + enrollment_date = fields.Date(string="Enrollment Date") + + # Fee Info fees_structure = fields.Char(string="Fees Structure") fees_status = fields.Selection([ ('paid', 'Paid'), ('partial', 'Partially Paid'), ('unpaid', 'Unpaid') ], string="Fees Status", default="unpaid") + session_status = fields.Selection([ ('active', 'Active'), ('completed', 'Completed'), ('drop', 'Dropped') ], string="Session Status", default="active") - enrollment_date = fields.Date(string="Enrollment Date") + status = fields.Selection([ ('draft', 'Draft'), ('confirmed', 'Confirmed'), ('cancelled', 'Cancelled') ], string="Status", default='draft') + + # Linked lines subject_line_ids = fields.One2many('school.enrollment.subject', 'enrollment_id', string="Subjects") fee_summary_line_ids = fields.One2many('school.enrollment.fee.summary', 'enrollment_id', string="Fee Summary") - course_id = fields.Many2one('school.course', string='Course', ondelete='cascade', required=True) - student_id = fields.Many2one('res.partner', string='Student', required=True) - @api.depends('application_id') - def _compute_student_id(self): - for rec in self: - rec.student_id = str(rec.application_id.id) if rec.application_id else '' \ No newline at end of file + course_id = fields.Many2one('school.course', string='Course', ondelete='cascade', required=True) diff --git a/models/schedule.py b/models/schedule.py index b835cde..8af4170 100644 --- a/models/schedule.py +++ b/models/schedule.py @@ -56,14 +56,4 @@ class SchoolClassSchedule(models.Model): ('ended', 'Ended') ], string="Session Status") - def action_send_message(self): - for record in self: - raise UserError("Send Message clicked for %s" % record.name) - - def action_log_note(self): - for record in self: - raise UserError("Log Note clicked for %s" % record.name) - - def action_schedule_activity(self): - for record in self: - raise UserError("Activity clicked for %s" % record.name) \ No newline at end of file + \ No newline at end of file diff --git a/models/school_course.py b/models/school_course.py index af31434..2b21ef3 100644 --- a/models/school_course.py +++ b/models/school_course.py @@ -17,9 +17,4 @@ class SchoolCourse(models.Model): attendance_ids = fields.One2many('school.course.attendance', 'course_id', string='Attendance') enrolled_student_ids = fields.One2many('school.course.student', 'course_id', string='Enrolled Students') attendance_ids = fields.One2many('school.course.attendance', 'course_id', string='Attendance') - schedule_line_ids = fields.One2many('school.course.schedule', 'course_id', string='Weekly Schedule') assignment_ids = fields.One2many('school.course.assignment', 'course_id', string='Assignments') - - - - \ No newline at end of file diff --git a/models/school_course_assignment.py b/models/school_course_assignment.py index 86dc3c9..76864d3 100644 --- a/models/school_course_assignment.py +++ b/models/school_course_assignment.py @@ -33,14 +33,4 @@ class SchoolCourseAssignment(models.Model): rec.assignment_count = 0 - def action_send_message(self): - for record in self: - raise UserError("Send Message clicked for %s" % record.name) - - def action_log_note(self): - for record in self: - raise UserError("Log Note clicked for %s" % record.name) - - def action_schedule_activity(self): - for record in self: - raise UserError("Activity clicked for %s" % record.name) \ No newline at end of file + \ No newline at end of file diff --git a/models/school_course_schedule.py b/models/school_course_schedule.py index decf9ce..2f3154e 100644 --- a/models/school_course_schedule.py +++ b/models/school_course_schedule.py @@ -1,39 +1,6 @@ from odoo import models, fields -from odoo.exceptions import UserError -_inherit = ['mail.thread', 'mail.activity.mixin'] class SchoolCourseSchedule(models.Model): - _name = 'school.course.schedule' - _description = 'Weekly Schedule' - - course_id = fields.Many2one('school.course', string='Course', ondelete='cascade') - schedule_time = fields.Char(string='Schedule Time') - day = fields.Selection([ - ('mon', 'Monday'), - ('tue', 'Tuesday'), - ('wed', 'Wednesday'), - ('thu', 'Thursday'), - ('fri', 'Friday'), - ('sat', 'Saturday'), - ('sun', 'Sunday'), - ], string='Day') - location = fields.Char(string='Location') - period = fields.Char(string='Period') - status = fields.Selection([ - ('planned', 'Planned'), - ('ongoing', 'Ongoing'), - ('completed', 'Completed') - ], string='Status', default='planned') + _inherit = 'hr.leave' # not 'school.course.schedule' - - def action_send_message(self): - for record in self: - raise UserError("Send Message clicked for %s" % record.name) - - def action_log_note(self): - for record in self: - raise UserError("Log Note clicked for %s" % record.name) - - def action_schedule_activity(self): - for record in self: - raise UserError("Activity clicked for %s" % record.name) \ No newline at end of file + \ No newline at end of file diff --git a/models/school_student.py b/models/school_student.py index 7a328bd..4785084 100644 --- a/models/school_student.py +++ b/models/school_student.py @@ -1,32 +1,25 @@ from odoo import models, fields, api -from odoo.exceptions import UserError class SchoolStudent(models.Model): _name = 'school.student' _description = 'Student' application_id = fields.Many2one('school.application', string="Application", required=True) - - # Use computed char field instead of invalid related field - student_id = fields.Char(string="Student ID", compute='_compute_student_id', store=True) - profile_photo = fields.Binary(related='application_id.image', string="Profile Photo", store=True) + student_id = fields.Char(string="Student ID", compute='_compute_student_id', store=True) + + # Related fields (autofilled from application) student_name = fields.Char(related='application_id.name', string="Student Name", store=True) + profile_photo = fields.Binary(related='application_id.image', string="Profile Photo", store=True) + phone_no = fields.Char(related='application_id.phone_no', string="Phone No", store=True) + roll_no = fields.Char(related='application_id.roll_no', string="Roll Number", store=True, readonly=True) + school_id = fields.Many2one('res.company', string="School", default=lambda self: self.env.company) enrollment_date = fields.Date(string="Enrollment Date") class_name = fields.Selection([ - ('1', 'Class 1'), - ('2', 'Class 2'), - ('3', 'Class 3'), - ('4', 'Class 4'), - ('5', 'Class 5'), - ('6', 'Class 6'), - ('7', 'Class 7'), - ('8', 'Class 8'), - ('9', 'Class 9'), - ('10', 'Class 10'), - ('11', 'Class 11'), - ('12', 'Class 12'), + ('1', 'Class 1'), ('2', 'Class 2'), ('3', 'Class 3'), ('4', 'Class 4'), + ('5', 'Class 5'), ('6', 'Class 6'), ('7', 'Class 7'), ('8', 'Class 8'), + ('9', 'Class 9'), ('10', 'Class 10'), ('11', 'Class 11'), ('12', 'Class 12'), ], string="Class", required=True) academic_year = fields.Char(string="Academic Year") session_status = fields.Selection([ diff --git a/models/school_subject.py b/models/school_subject.py index 814d930..ab9cf41 100644 --- a/models/school_subject.py +++ b/models/school_subject.py @@ -45,38 +45,42 @@ class SchoolSubject(models.Model): lesson_plan = fields.Text(string='Lesson Plan') teacher = fields.Many2one('res.users', string='Teacher') lesson_plan_line_ids = fields.One2many('school.subject.lesson', 'subject_id', string='Lesson Plans') - teacher_info_line_ids = fields.One2many('school.subject.teacher.info', 'subject_id', string="Teacher Info") + teacher_info_line_ids = fields.One2many('hr.employee', 'subject_id', string="Teacher Info") - @api.depends('class_name') - def _compute_subjects(self): - subject_mapping = { - 'Class 1': ['Math', 'English', 'Science', 'MIL'], - 'Class 2': ['Math', 'English', 'Science', 'Drawing', 'MIL'], - 'Class 3': ['Math', 'English', 'Science', 'Odia', 'Drawing', 'English Grammar'], - 'Class 4': ['Math', 'English', 'Science', 'Odia', 'Drawing', 'English Grammar'], - 'Class 5': ['Math', 'English', 'Science', 'Odia', 'History', 'Drawing', 'English Grammar'], - 'Class 6': ['Math', 'English', 'Science', 'Geography', 'MIL', 'English Grammar'], - 'Class 7': ['Math', 'English', 'Science', 'Political Science', 'MIL', 'English Grammar', 'History', 'Geography'], - 'Class 8': ['Math', 'English', 'Science', 'Political Science', 'MIL', 'English Grammar', 'History', 'Geography'], - 'Class 9': ['Math', 'English', 'Physical Science', 'Life Science', 'English Grammar', 'Economic Science', 'History', 'Geography'], - 'Class 10': ['Math', 'English', 'Physical Science', 'Life Science', 'English Grammar', 'Economic Science', 'History', 'Geography'], - 'Class 11': ['Physics', 'Chemistry', 'Math', 'Biology', 'English', 'English Grammar', 'Computer Science', 'MIL', 'Economic Science'], - 'Class 12': ['Physics', 'Chemistry', 'Math', 'Biology', 'Computer Science', 'English Grammar', 'English', 'MIL', 'Economic Science'], + + @api.model + def get_subjects_by_class(self): + return { + 'Class 1': ['math', 'english', 'science', 'mil'], + 'Class 2': ['math', 'english', 'science', 'drawing', 'mil'], + 'Class 3': ['math', 'english', 'science', 'odia', 'drawing', 'english_grammar'], + 'Class 4': ['math', 'english', 'science', 'odia', 'drawing', 'english_grammar'], + 'Class 5': ['math', 'english', 'science', 'odia', 'history', 'drawing', 'english_grammar'], + 'Class 6': ['math', 'english', 'science', 'geography', 'mil', 'english_grammar'], + 'Class 7': ['math', 'english', 'science', 'political_science', 'mil', 'english_grammar', 'history', 'geography'], + 'Class 8': ['math', 'english', 'science', 'political_science', 'mil', 'english_grammar', 'history', 'geography'], + 'Class 9': ['math', 'english', 'physical_science', 'life_science', 'english_grammar', 'economic_science', 'history', 'geography'], + 'Class 10': ['math', 'english', 'physical_science', 'life_science', 'english_grammar', 'economic_science', 'history', 'geography'], + 'Class 11': ['physics', 'chemistry', 'math', 'biology', 'english', 'english_grammar', 'computer_science', 'mil', 'economic_science'], + 'Class 12': ['physics', 'chemistry', 'math', 'biology', 'computer_science', 'english_grammar', 'english', 'mil', 'economic_science'], } - for rec in self: - rec.subject_list = ', '.join(subject_mapping.get(rec.class_name, [])) + def action_generate_subjects(self): if not self.class_name: raise UserError("Please select a class name first.") + # Get existing subjects for this class existing_subjects = self.search([ ('class_name', '=', self.class_name) ]).mapped('name') + # Get list of subjects by key (not label) subject_list = self.get_subjects_by_class().get(self.class_name, []) + # Filter out already existing ones new_subjects = [sub for sub in subject_list if sub not in existing_subjects] + # Create new records for subject in new_subjects: self.create({ 'class_name': self.class_name, diff --git a/models/school_subject_lesson.py b/models/school_subject_lesson.py index 23ceb01..6f3d425 100644 --- a/models/school_subject_lesson.py +++ b/models/school_subject_lesson.py @@ -25,14 +25,4 @@ class SchoolSubjectLesson(models.Model): for record in self: record.activity_count = len(record.subject_id.teacher_info_line_ids) - def action_send_message(self): - for record in self: - raise UserError("Send Message clicked for %s" % record.name) - - def action_log_note(self): - for record in self: - raise UserError("Log Note clicked for %s" % record.name) - - def action_schedule_activity(self): - for record in self: - raise UserError("Activity clicked for %s" % record.name) \ No newline at end of file + \ No newline at end of file diff --git a/models/school_subject_teacher_info.py b/models/school_subject_teacher_info.py index 1949564..93bd01c 100644 --- a/models/school_subject_teacher_info.py +++ b/models/school_subject_teacher_info.py @@ -1,34 +1,19 @@ from odoo import models, fields, api -class SchoolSubjectTeacherInfo(models.Model): - _name = 'school.subject.teacher.info' - _description = 'Subject Teacher Info' +class HrEmployee(models.Model): + _inherit = 'hr.employee' - subject_id = fields.Many2one('school.subject', string='Subject', required=True, ondelete='cascade') - - # Related fields to auto-fetch from related subject's teacher (res.users) - teacher_user_id = fields.Many2one(related='subject_id.teacher', string="Teacher User", store=True) - employee_name = fields.Char(string='Teacher Name', compute="_compute_teacher_fields", store=True) - phone = fields.Char(string='Phone', compute="_compute_teacher_fields", store=True) - email = fields.Char(string='Email', compute="_compute_teacher_fields", store=True) - profile_photo = fields.Binary(string="Profile Photo", compute="_compute_teacher_fields", store=True) - - # Editable fields for extra info + subject_id = fields.Many2one('school.subject', string="Subject") activity = fields.Char(string='Activity') + department = fields.Many2one('hr.department', string="Department") activity_deadline = fields.Date(string='New Activity Deadline') - department = fields.Char(string='Department') - job_position = fields.Char(string='Job Position') - manager = fields.Char(string='Manager') - address = fields.Text(string="Address") experience = fields.Integer(string="Experience (Years)") - date_of_birth = fields.Date(string="Date of Birth") - join_date = fields.Date(string="Join Date") + extra_info = fields.Text(string="Extra Info") + manager = fields.Char(string="Manager") + job_position = fields.Char(string="Job Position") + employee_name = fields.Char(compute="_compute_employee_name", store=True) - @api.depends('subject_id.teacher') - def _compute_teacher_fields(self): + @api.depends('name') + def _compute_employee_name(self): for rec in self: - user = rec.subject_id.teacher - rec.employee_name = user.name if user else '' - rec.email = user.email if user else '' - rec.phone = user.phone if user else '' - rec.profile_photo = user.image_1920 if user else False + rec.employee_name = rec.name diff --git a/report/school_id_card_report.xml b/report/school_id_card_report.xml new file mode 100644 index 0000000..2256a91 --- /dev/null +++ b/report/school_id_card_report.xml @@ -0,0 +1,30 @@ + + + + ID Card + school.application + qweb-pdf + school_management.report_school_id_card_document + school_management.report_school_id_card_document + "'ID Card - %s' % (object.name)" + + + + diff --git a/security/ir.model.access.csv b/security/ir.model.access.csv index 018e9b8..4e2cb33 100644 --- a/security/ir.model.access.csv +++ b/security/ir.model.access.csv @@ -10,11 +10,8 @@ access_school_subject,School Subject,model_school_subject,,1,1,1,1 access_school_course,School Course,model_school_course,,1,1,1,1 access_school_course_attendance,School Course Attendance,model_school_course_attendance,,1,1,1,1 access_school_course_student,School Course Student,model_school_course_student,,1,1,1,1 -access_school_course_schedule,School Course Schedule,model_school_course_schedule,,1,1,1,1 access_school_course_assignment,School Course Assignment,model_school_course_assignment,,1,1,1,1 access_school_subject_lesson,School Subject Lesson,model_school_subject_lesson,,1,1,1,1 -access_school_subject_teacher_info,School Subject Teacher Info,model_school_subject_teacher_info,,1,1,1,1 -access_school_subject_teacher_info_admin,Subject Teacher Info,model_school_subject_teacher_info,school_management.group_school_admin,1,1,1,1 access_teacher_attendance,Teacher Attendance,model_school_teacher_attendance,,1,1,1,1 access_school_notice_board,School Notice Board,model_school_notice_board,,1,1,1,1 access_school_reporting_dummy,School Reporting Dummy,model_school_reporting_dummy,,1,1,1,1 diff --git a/views/application.xml b/views/application.xml index c9c66a9..c235a55 100644 --- a/views/application.xml +++ b/views/application.xml @@ -1,6 +1,6 @@ - + school.application.list school.application @@ -8,6 +8,7 @@ + @@ -28,18 +29,20 @@
+ + + - - + @@ -53,47 +56,53 @@ string="Show ID Card" type="object" class="btn-primary"/> +