update school management

This commit is contained in:
Truptimayee Dash 2025-08-06 14:53:00 +05:30
parent fd6e55ccbb
commit d672e9c566
33 changed files with 344 additions and 443 deletions

View File

@ -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',

View File

@ -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", )
# 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")
@ -81,13 +78,20 @@ 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 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},
# }
def print_id_card(self):
self.ensure_one()
return self.env.ref('school_management.report_school_id_card').report_action(self)

View File

@ -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 ''
course_id = fields.Many2one('school.course', string='Course', ondelete='cascade', required=True)

View File

@ -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)

View File

@ -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')

View File

@ -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)

View File

@ -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)

View File

@ -1,5 +1,4 @@
from odoo import models, fields, api
from odoo.exceptions import UserError
class SchoolStudent(models.Model):
_name = 'school.student'
@ -7,26 +6,20 @@ class SchoolStudent(models.Model):
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)
# 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([

View File

@ -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,

View File

@ -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)

View File

@ -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

View File

@ -0,0 +1,30 @@
<odoo>
<record id="report_school_id_card" model="ir.actions.report">
<field name="name">ID Card</field>
<field name="model">school.application</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">school_management.report_school_id_card_document</field>
<field name="report_file">school_management.report_school_id_card_document</field>
<field name="print_report_name">"'ID Card - %s' % (object.name)"</field>
</record>
<template id="report_school_id_card_document">
<t t-call="web.basic_layout">
<t t-foreach="docs" t-as="doc">
<div class="page">
<div style="text-align:center; border:1px solid black; padding:20px; border-radius:10px; width:400px; margin:auto;">
<h2>Student ID Card</h2>
<img t-if="doc.image" t-att-src="'data:image/png;base64,%s' % doc.image.decode('utf-8')" width="100" height="100"/>
<p><strong>Name:</strong> <t t-esc="doc.name"/></p>
<p><strong>Roll No:</strong> <t t-esc="doc.roll_no"/></p>
<p><strong>Class:</strong> <t t-esc="doc.class_name"/></p>
<p><strong>Father's Name:</strong> <t t-esc="doc.father_name"/></p>
<p><strong>DOB:</strong> <t t-esc="doc.date_of_birth"/></p>
<p><strong>Blood Group:</strong> <t t-esc="doc.blood_group"/></p>
</div>
</div>
</t>
</t>
</template>
</odoo>

View File

@ -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

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
10 access_school_course School Course model_school_course 1 1 1 1
11 access_school_course_attendance School Course Attendance model_school_course_attendance 1 1 1 1
12 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
13 access_school_course_assignment School Course Assignment model_school_course_assignment 1 1 1 1
14 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
15 access_teacher_attendance Teacher Attendance model_school_teacher_attendance 1 1 1 1
16 access_school_notice_board School Notice Board model_school_notice_board 1 1 1 1
17 access_school_reporting_dummy School Reporting Dummy model_school_reporting_dummy 1 1 1 1

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<!-- Tree View -->
<!-- list View -->
<record id="view_school_application_list" model="ir.ui.view">
<field name="name">school.application.list</field>
<field name="model">school.application</field>
@ -8,6 +8,7 @@
<list>
<field name="image" widget="image" class="oe_avatar" options="{'preview_image': 'image', 'size': [40, 40]}"/>
<field name="name"/>
<field name="partner_id"/>
<field name="email"/>
<field name="phone_no"/>
<field name="class_name"/>
@ -28,18 +29,20 @@
<div class="oe_avatar">
<field name="image" widget="image" class="oe_avatar"/>
</div>
<group>
<group>
<field name="partner_id"/>
<field name="name"/>
<field name="roll_no" placeholder="Click here to generate roll no"/>
<field name="email"/>
<field name="phone_no"/>
<field name="address"/>
<field name="class_name"/>
<field name="gender"/>
<field name="date_of_birth"/>
</group>
<group>
<field name="date_of_birth"/>
<field name="parent_email"/>
<field name="blood_group"/>
<field name="school_name"/>
@ -53,47 +56,53 @@
string="Show ID Card"
type="object"
class="btn-primary"/>
<button name="print_id_card"
string="Download ID Card"
type="object"
class="btn-secondary"
icon="fa-download"/>
</group>
</group>
<notebook>
<!-- Parent Details Tab -->
<page string="Parent Details">
<group>
<group>
<field name="father_name"/>
<field name="father_occupation"/>
<field name="father_phone"/>
</group>
<group>
<field name="mother_name"/>
<field name="mother_occupation"/>
<field name="mother_phone"/>
</group>
</group>
</page>
<!-- Parent Details Tab -->
<page string="Parent Details">
<group>
<group>
<field name="father_name"/>
<field name="father_occupation"/>
<field name="father_phone"/>
</group>
<group>
<field name="mother_name"/>
<field name="mother_occupation"/>
<field name="mother_phone"/>
</group>
</group>
</page>
<!-- Admission Query Tab -->
<page string="Admission Query">
<group>
<field name="admission_query" placeholder="Write any special query here..."/>
</group>
</page>
<!-- Admission Query Tab -->
<page string="Admission Query">
<group>
<field name="admission_query" placeholder="Write any special query here..."/>
</group>
</page>
<!-- Documents Upload Tab -->
<page string="Documents">
<group>
<field name="birth_certificate" filename="birth_certificate"/>
<field name="aadhaar_card" filename="aadhaar_card"/>
<field name="tc_certificate" filename="tc_certificate"/>
</group>
</page>
</notebook>
<!-- Documents Upload Tab -->
<page string="Documents">
<group>
<field name="birth_certificate" filename="birth_certificate"/>
<field name="aadhaar_card" filename="aadhaar_card"/>
<field name="tc_certificate" filename="tc_certificate"/>
</group>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<!-- ID Card View -->
<record id="view_school_id_card_form" model="ir.ui.view">
<field name="name">school.application.id.card</field>
<field name="model">school.application</field>
@ -103,11 +112,12 @@
<div style="max-width: 300px; margin: auto; border: 2px solid #000; padding: 20px; text-align: center; border-radius: 10px;">
<div style="text-align: center; margin-bottom: 15px;">
<field name="image" widget="image"
style="width: 70px; height: 70px; border-radius: 50%; object-fit: cover; display: inline-block;"/>
style="width: 50px; height: 50px; border-radius: 50%; object-fit: cover; display: inline-block;"/>
</div>
<div style="margin-left: 20px;">
<h2 style="margin-bottom: 10px;"><field name="name" readonly="1"/></h2>
<h2 style="margin-bottom: 8px;"><field name="name" readonly="1"/></h2>
<p><strong>School:</strong> <field name="school_name" readonly="1"/></p>
<p><strong>Roll No:</strong> <field name="roll_no" readonly="1"/></p>
<p><strong>Academic Year:</strong> <field name="academic_year" readonly="1"/></p>
<p><strong>Blood Group:</strong> <field name="blood_group" readonly="1"/></p>
<p><strong>Father's Name:</strong> <field name="father_name" readonly="1"/></p>
@ -127,6 +137,7 @@
<kanban class="o_kanban_small_column">
<field name="image"/>
<field name="name"/>
<field name="partner_id"/>
<field name="email"/>
<field name="phone_no"/>
<field name="status"/>
@ -134,10 +145,11 @@
<t t-name="kanban-box">
<div class="d-flex align-items-start" style="gap: 20px;">
<div>
<field name="image" widget="image" alt="Product" style="width: 60px; height: 60px; object-fit: cover;" options="{'img_class': 'w-100 object-fit-contain'}" invisible="not image"/>
<field name="image" widget="image" style="width: 60px; height: 60px; object-fit: cover;" options="{'img_class': 'w-100 object-fit-contain'}" invisible="not image"/>
</div>
<div class="o_kanban_details">
<strong><field name="name"/></strong><br/>
<i class="fa fa-user"/> <field name="partner_id"/><br/>
<i class="fa fa-envelope"/> <field name="email"/><br/>
<i class="fa fa-phone"/> <field name="phone_no"/><br/>
<field name="status"/>
@ -149,7 +161,6 @@
</field>
</record>
<!-- Pivot View -->
<record id="view_school_application_pivot" model="ir.ui.view">
<field name="name">school.application.pivot</field>

View File

@ -32,11 +32,6 @@
<field name="due_date"/>
</group>
</group>
<div class="oe_button_box d-flex" name="custom_buttons" style="margin: 10px 0; gap: 10px;">
<button type="object" name="action_send_message" class="btn btn-primary" string="Send Message"/>
<button type="object" name="action_log_note" class="btn btn-secondary" string="Log Note"/>
<button type="object" name="action_schedule_activity" class="btn btn-info" string="Activity"/>
</div>
</sheet>
</form>
</field>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<!-- Tree View -->
<!-- list View -->
<record id="view_school_class_list" model="ir.ui.view">
<field name="name">school.class.list</field>
<field name="model">school.class</field>

View File

@ -52,19 +52,6 @@
</field>
</page>
<!-- TAB 2: Weekly Schedule -->
<page string="Weekly Schedule">
<field name="schedule_line_ids">
<list editable="bottom">
<field name="schedule_time"/>
<field name="day"/>
<field name="location"/>
<field name="period"/>
<field name="status"/>
</list>
</field>
</page>
<!-- TAB 3: Assignment -->
<page string="Assignment">
<field name="assignment_ids">

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<!-- Tree (List) View -->
<!-- List View -->
<record id="view_school_enrollment_list" model="ir.ui.view">
<field name="name">school.enrollment.list</field>
<field name="model">school.enrollment</field>
<field name="arch" type="xml">
<list>
<field name="image" widget="image" class="oe_avatar" options="{'preview_image': 'image', 'size': [40, 40]}"/>
<field name="student_name"/>
<field name="student_id"/>
<field name="class_name"/>
<field name="fees_status"/>
<field name="session_status"/>
@ -16,7 +16,6 @@
</field>
</record>
<!-- Form View -->
<record id="view_school_enrollment_form" model="ir.ui.view">
<field name="name">school.enrollment.form</field>
@ -24,16 +23,16 @@
<field name="arch" type="xml">
<form string="Enrollment Form">
<sheet>
<div class="oe_title">
<div class="oe_avatar" style="margin-bottom: 15px;">
<field name="image" widget="image" class="oe_avatar" options="{'preview_image': 'image'}"/>
<div class="oe_title">
<div class="oe_avatar" style="margin-bottom: 15px;">
<field name="image" widget="image" class="oe_avatar" options="{'preview_image': 'image'}"/>
</div>
</div>
</div>
<!-- Main Two-Column Group -->
<group>
<group>
<field name="student_name"/>
<field name="application_id"/>
<field name="student_id"/>
<field name="school_id"/>
<field name="class_name"/>
<field name="course"/>
@ -47,66 +46,57 @@
<field name="enrollment_date"/>
</group>
</group>
<notebook>
<!-- Subject Tab -->
<page string="Subjects">
<field name="subject_line_ids">
<list editable="bottom">
<field name="subject_name"/>
<field name="class_name"/>
<field name="academic_year"/>
<field name="status"/>
</list>
</field>
</page>
<!-- Fee Summary Tab -->
<page string="Fee Summary">
<field name="fee_summary_line_ids">
<list editable="bottom">
<field name="total_fees"/>
<field name="paid_fees"/>
<field name="fee_slip_amount"/>
<field name="due_fees"/>
<field name="fee_element"/>
<field name="frequency"/>
<field name="amount_paid"/>
</list>
</field>
</page>
</notebook>
</sheet>
<notebook>
<!-- Subject Tab -->
<page string="Subjects">
<field name="subject_line_ids">
<list editable="bottom">
<field name="subject_name"/>
<field name="class_name"/>
<field name="academic_year"/>
<field name="status"/>
</list>
</field>
</page>
<!-- Fee Summary Tab -->
<page string="Fee Summary">
<field name="fee_summary_line_ids">
<list editable="bottom">
<field name="total_fees"/>
<field name="paid_fees"/>
<field name="fee_slip_amount"/>
<field name="due_fees"/>
<field name="fee_element"/>
<field name="frequency"/>
<field name="amount_paid"/>
</list>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<!-- Kanban View -->
<record id="view_school_enrollment_kanban" model="ir.ui.view">
<field name="name">school.enrollment.kanban</field>
<field name="model">school.enrollment</field>
<field name="arch" type="xml">
<kanban class="o_kanban_small_column">
<!-- Declare fields used -->
<field name="student_name"/>
<field name="student_id"/>
<field name="class_name"/>
<field name="course"/>
<field name="fees_status"/>
<field name="session_status"/>
<field name="enrollment_date"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click o_kanban_record" style="padding: 8px;">
<!-- Top: Student Name -->
<strong>
<field name="student_name"/>
</strong><br/>
<!-- Info Grid -->
<strong><field name="student_id"/></strong><br/>
<div style="margin-top: 8px;">
<!-- <div><strong>Class:</strong> <field name="class_name"/></div> -->
<div><strong>Course:</strong> <field name="course"/></div>
<div><strong>Fees:</strong> <field name="fees_status"/></div>
<div><strong>Session:</strong> <field name="session_status"/></div>
@ -119,6 +109,7 @@
</field>
</record>
<!-- Pivot View -->
<record id="view_school_enrollment_pivot" model="ir.ui.view">
<field name="name">school.enrollment.pivot</field>
<field name="model">school.enrollment</field>
@ -143,8 +134,7 @@
</field>
</record>
<!-- Action Window -->
<!-- Action -->
<record id="action_school_enrollment" model="ir.actions.act_window">
<field name="name">Enrollment</field>
<field name="res_model">school.enrollment</field>

View File

@ -63,7 +63,7 @@
<menuitem id="menu_teacher_timeoff"
name="Time Off"
parent="menu_teachers_root"
action="action_school_course_schedule"
action="action_course_schedule_hr_leave"
sequence="5"/>
<!-- Notice Board Menu -->

View File

@ -1,13 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<!-- list View -->
<!-- List View -->
<record id="view_school_student_list" model="ir.ui.view">
<field name="name">school.student.list</field>
<field name="model">school.student</field>
<field name="arch" type="xml">
<list>
<field name="student_name"/>
<field name="roll_no"/>
<field name="phone_no"/>
<field name="school_id"/>
<field name="class_name"/>
<field name="academic_year"/>
@ -33,7 +35,9 @@
</group>
<group>
<group>
<field name="student_name"/>
<field name="student_name" readonly="1"/>
<field name="roll_no"/>
<field name="phone_no" readonly="1"/>
<field name="application_id"/>
<field name="school_id"/>
<field name="class_name"/>
@ -52,6 +56,7 @@
</form>
</field>
</record>
<!-- Kanban View -->
<record id="view_school_student_kanban" model="ir.ui.view">
<field name="name">school.student.kanban</field>
@ -66,11 +71,14 @@
<div class="oe_kanban_global_click o_kanban_record">
<div class="d-flex align-items-center" style="gap: 12px;">
<div>
<field name="profile_photo" widget="image" style="width: 60px; height: 60px; object-fit: cover;" options="{'img_class': 'w-100'}" />
<field name="profile_photo" widget="image"
style="width: 60px; height: 60px; object-fit: cover;"
options="{'img_class': 'w-100'}" />
</div>
<div>
<strong><field name="student_id"/></strong><br/>
<small>Class: <field name="class_name"/></small>
<strong><field name="student_name"/></strong><br/>
<small>Class: <field name="class_name"/></small><br/>
<small>Phone: <field name="phone_no"/></small>
</div>
</div>
</div>
@ -90,7 +98,7 @@
</field>
</record>
<!-- Menu: School Management > Students > All Students -->
<!-- Menu Items -->
<menuitem id="menu_school_student_root"
name="Students"
parent="menu_school_root"
@ -101,5 +109,4 @@
parent="menu_school_student_root"
action="action_school_student"
sequence="1" />
</odoo>

View File

@ -1,77 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- list View -->
<record id="view_school_subject_teacher_list" model="ir.ui.view">
<field name="name">school.subject.teacher.list</field>
<field name="model">school.subject.teacher.info</field>
<!-- Form View Inherited from hr.employee -->
<record id="view_school_subject_teacher_form" model="ir.ui.view">
<field name="name">school.subject.teacher.form</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<list string="Subject Teacher Info">
<field name="employee_name"/>
<field name="subject_id"/>
<field name="phone"/>
<field name="email"/>
<field name="date_of_birth"/>
<field name="join_date"/>
<xpath expr="//field[@name='work_email']" position="after">
<field name="activity"/>
<field name="activity_deadline"/>
</xpath>
<xpath expr="//field[@name='department_id']" position="after">
<field name="experience"/>
</list>
<field name="extra_info"/>
<field name="manager"/>
<field name="job_position"/>
</xpath>
</field>
</record>
<!-- Form View -->
<record id="view_school_subject_teacher_form" model="ir.ui.view">
<field name="name">school.subject.teacher.form</field>
<field name="model">school.subject.teacher.info</field>
<!-- List View -->
<record id="view_school_subject_teacher_list" model="ir.ui.view">
<field name="name">school.subject.teacher.list</field>
<field name="model">hr.employee</field>
<field name="arch" type="xml">
<form string="Subject Teacher Info">
<sheet>
<group>
<group>
<field name="profile_photo" widget="image" class="oe_avatar" options="{'preview_image': 'profile_photo'}"/>
<field name="employee_name"/>
<field name="subject_id"/>
<field name="phone"/>
<field name="email"/>
<field name="date_of_birth"/>
<field name="join_date"/>
</group>
<group>
<field name="activity"/>
<field name="activity_deadline"/>
<field name="department"/>
<field name="job_position"/>
<field name="manager"/>
<field name="experience"/>
<field name="address"/>
</group>
</group>
</sheet>
</form>
<list string="Subject Teacher List">
<field name="name"/>
<field name="job_title"/>
<field name="work_email"/>
<field name="mobile_phone"/>
<field name="experience"/>
</list>
</field>
</record>
<!-- Kanban View -->
<record id="view_school_subject_teacher_kanban" model="ir.ui.view">
<field name="name">school.subject.teacher.kanban</field>
<field name="model">school.subject.teacher.info</field>
<field name="model">hr.employee</field>
<field name="arch" type="xml">
<kanban class="o_kanban_example">
<field name="employee_name"/>
<field name="profile_photo"/>
<field name="subject_id"/>
<field name="email"/>
<field name="phone"/>
<kanban>
<field name="name"/>
<field name="image_1920"/>
<field name="job_title"/>
<field name="work_email"/>
<field name="mobile_phone"/>
<templates>
<t t-name="kanban-box">
<div class="d-flex align-items-center" style="gap: 20px;" >
<div>
<field name="profile_photo" widget="image" alt="Product" style="width: 60px; height: 60px; object-fit: cover;" options="{'img_class': 'w-100 object-fit-contain'}" invisible="not profile_photo"/>
<div class="o_kanban_record">
<div class="o_kanban_image">
<img t-att-src="kanban_image('hr.employee', 'image_1920', record.id.value)" class="img img-fluid rounded-circle" t-att-alt="record.name.value"/>
</div>
<div class="o_kanban_details">
<strong><field name="employee_name"/></strong><br/>
<small><field name="subject_id"/></small><br/>
<i class="fa fa-envelope"/> <field name="email"/><br/>
<i class="fa fa-phone"/> <field name="phone"/>
<strong><field name="name"/></strong><br/>
<span t-if="record.job_title.raw_value"><br/>
<field name="job_title"/></span><br/>
<i class="fa fa-envelope"/> <field name="work_email"/><br/>
<i class="fa fa-phone"/> <field name="mobile_phone"/><br/>
</div>
</div>
</t>
@ -80,41 +68,25 @@
</field>
</record>
<!--Pivot View-->
<record id="view_school_subject_teacher_pivot" model="ir.ui.view">
<field name="name">school.subject.teacher.pivot</field>
<field name="model">school.subject.teacher.info</field>
<field name="arch" type="xml">
<pivot string="Subject Teacher Stats" disable_linking="True">
<field name="subject_id" type="row"/>
<field name="department" type="row"/>
<field name="job_position" type="row"/>
<field name="experience" type="measure"/>
<!-- <field name="join_date" interval="month" type="column"/> -->
</pivot>
</field>
</record>
<!-- Search View -->
<record id="view_school_subject_teacher_search" model="ir.ui.view">
<field name="name">school.subject.teacher.search</field>
<field name="model">school.subject.teacher.info</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_filter"/>
<field name="arch" type="xml">
<search>
<field name="employee_name"/>
<field name="subject_id"/>
<field name="email"/>
<field name="department"/>
</search>
<xpath expr="//search" position="inside">
<field name="experience"/>
</xpath>
</field>
</record>
<!-- Action -->
<record id="action_school_subject_teacher_info" model="ir.actions.act_window">
<field name="name">All Teachers</field>
<field name="res_model">school.subject.teacher.info</field>
<field name="view_mode">kanban,search,pivot,list,form</field>
</record>
</odoo>
<field name="name">Subject Teachers</field>
<field name="res_model">hr.employee</field>
<field name="view_mode">kanban,list,form,search</field>
</record>
</odoo>

View File

@ -8,10 +8,11 @@
<field name="binding_model_id" ref="model_school_subject"/>
<field name="binding_view_types">form</field>
<field name="code">
action = env['school.subject'].create_subjects_for_class(record.class_name)
record.action_generate_subjects()
</field>
</record>
<!-- List View -->
<record id="view_school_subject_list" model="ir.ui.view">
<field name="name">school.subject.list</field>

View File

@ -1,46 +1,47 @@
<odoo>
<record id="view_timeoff_list" model="ir.ui.view">
<field name="name">school.course.schedule.list</field>
<field name="model">school.course.schedule</field>
<!-- Inherit Form View: Change Title -->
<record id="view_hr_leave_form_inherit_course_schedule_title" model="ir.ui.view">
<field name="name">hr.leave.form.course.schedule.title</field>
<field name="model">hr.leave</field>
<field name="inherit_id" ref="hr_holidays.hr_leave_view_form"/>
<field name="arch" type="xml">
<list>
<field name="course_id"/>
<field name="day"/>
<field name="schedule_time"/>
<field name="location"/>
<field name="period"/>
<field name="status"/>
</list>
<xpath expr="//form" position="attributes">
<attribute name="string">Course Schedule</attribute>
</xpath>
</field>
</record>
<record id="view_timeoff_form" model="ir.ui.view">
<field name="name">school.course.schedule.form</field>
<field name="model">school.course.schedule</field>
<!-- Inherit List View: Use Correct ID
<record id="view_hr_leave_list_inherit_course_schedule_title" model="ir.ui.view">
<field name="name">hr.leave.list.course.schedule.title</field>
<field name="model">hr.leave</field>
<field name="inherit_id" ref="hr_holidays.hr_leave_view_list"/>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="course_id"/>
<field name="day"/>
<field name="schedule_time"/>
<field name="location"/>
<field name="period"/>
<field name="status"/>
</group>
<div class="oe_button_box d-flex" name="custom_buttons" style="margin: 10px 0; gap: 10px;">
<button type="object" name="action_send_message" class="btn btn-primary" string="Send Message"/>
<button type="object" name="action_log_note" class="btn btn-secondary" string="Log Note"/>
<button type="object" name="action_schedule_activity" class="btn btn-info" string="Activity"/>
</div>
</sheet>
</form>
<xpath expr="//list" position="attributes">
<attribute name="string">Course Schedule List</attribute>
</xpath>
</field>
</record> -->
<!-- Inherit Calendar View -->
<record id="view_hr_leave_calendar_inherit_course_schedule_title" model="ir.ui.view">
<field name="name">hr.leave.calendar.course.schedule.title</field>
<field name="model">hr.leave</field>
<field name="inherit_id" ref="hr_holidays.hr_leave_view_calendar"/>
<field name="arch" type="xml">
<xpath expr="//calendar" position="attributes">
<attribute name="string">Course Schedule Calendar</attribute>
</xpath>
</field>
</record>
<record id="action_school_course_schedule" model="ir.actions.act_window">
<!-- Action Window -->
<record id="action_course_schedule_hr_leave" model="ir.actions.act_window">
<field name="name">Time Off</field>
<field name="res_model">school.course.schedule</field>
<field name="view_mode">list,form</field>
<field name="res_model">hr.leave</field>
<field name="view_mode">form,calendar</field>
<field name="context">{}</field>
</record>
</odoo>