my 2nd commit

This commit is contained in:
Truptimayee Dash 2025-08-04 12:57:45 +05:30
parent 19e8d93821
commit fd6e55ccbb
54 changed files with 762 additions and 214 deletions

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"git.ignoreLimitWarning": true
}

View File

@ -1,10 +1,10 @@
{ {
'name': 'School_Management', 'name': 'School_Management',
'version': '1.0', 'version': '1.0',
'depends': ['base', 'web', 'mail'], 'depends': ['base', 'web', 'mail','product'],
'license': 'LGPL-3', 'license': 'LGPL-3',
'data': [ 'data': [
'security/security.xml', 'security/security.xml',
'security/ir.model.access.csv', 'security/ir.model.access.csv',
'views/schedule.xml', 'views/schedule.xml',
'views/class.xml', 'views/class.xml',
@ -19,9 +19,11 @@
'views/timeoff_views.xml', 'views/timeoff_views.xml',
'views/teacher_attendance_view.xml', 'views/teacher_attendance_view.xml',
'views/school_misc_views.xml', 'views/school_misc_views.xml',
'views/school_reporting_views.xml', 'views/school_reporting_views.xml',
'views/menu.xml', 'views/school_student_views.xml',
'views/fee_structure_views.xml',
'views/fee_element_views.xml',
'views/menu.xml',
], ],
'installable': True, 'installable': True,
'application': True, 'application': True,

Binary file not shown.

View File

@ -15,5 +15,11 @@ from . import school_subject_lesson
from . import school_subject_teacher_info from . import school_subject_teacher_info
from . import teacher_attendance from . import teacher_attendance
from . import school_misc_menus from . import school_misc_menus
from . import school_student
from . import fee_structure
from . import fee_element
from . import school_fee_structure_line

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -9,15 +9,29 @@ class SchoolApplication(models.Model):
_description = 'Student Application' _description = 'Student Application'
_order = 'name' _order = 'name'
_rec_name = 'name' _rec_name = 'name'
_inherit = ['mail.thread', 'mail.activity.mixin']
# _inherit = ['mail.thread', 'mail.activity.mixin']
name = fields.Char(string="Student Name", required=True,) name = fields.Char(string="Student Name", required=True,)
email = fields.Char(string="Email", ) email = fields.Char(string="Email", )
phone_no = fields.Char(string="Phone Number") phone_no = fields.Char(string="Phone Number")
image = fields.Binary("Profile Photo", store=True) image = fields.Binary("Profile Photo", store=True)
address = fields.Text(string="Address") address = fields.Text(string="Address")
class_name = fields.Char(string="Class") 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'),
], string="Class", required=True)
academic_year = fields.Char(string="Academic Year")
gender = fields.Selection([ gender = fields.Selection([
('male', 'Male'), ('male', 'Male'),
('female', 'Female'), ('female', 'Female'),
@ -74,18 +88,31 @@ class SchoolApplication(models.Model):
if not re.fullmatch(r'\d{10}', record.phone_no or ''): if not re.fullmatch(r'\d{10}', record.phone_no or ''):
raise ValidationError("Phone number must contain exactly 10 digits.") raise ValidationError("Phone number must contain exactly 10 digits.")
def action_send_message(self): def action_show_id_card(self):
for record in self: self.ensure_one()
raise UserError("Send Message clicked for %s" % record.name) return {
'type': 'ir.actions.act_window',
'name': 'ID Card',
'view_mode': 'form',
'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
}
def action_log_note(self):
for record in self: @api.depends('application_id')
raise UserError("Log Note clicked for %s" % record.name) def _compute_student_id(self):
for rec in self:
rec.student_id = str(rec.application_id.id) if rec.application_id else ''
def action_schedule_activity(self): # def action_open_id_card_wizard(self):
for record in self: # return {
raise UserError("Activity clicked for %s" % record.name) # 'type': 'ir.actions.act_window',
# 'name': 'Generate ID Card',
# def get_default_image(self): # 'res_model': 'wizard.generate.id.card',
# with open('/path/to/sample.jpg', 'rb') as f: # 'view_mode': 'form',
# return base64.b64encode(f.read()) # 'target': 'new',
# 'context': {'default_application_id': self.id},
# }

View File

@ -1,14 +1,32 @@
from odoo import models, fields from odoo import models, fields, api
from odoo.exceptions import UserError _inherit = ['mail.thread', 'mail.activity.mixin']
class SchoolEnrollment(models.Model): class SchoolEnrollment(models.Model):
_name = 'school.enrollment' _name = 'school.enrollment'
_description = 'Enrollment' _description = 'Enrollment'
application_id = fields.Many2one('school.application', 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')
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'),
], string="Class", required=True)
student_id = fields.Many2one('school.application', string="Student", ondelete='set null')
image = fields.Binary(string="Profile Photo")
school_name = fields.Char(string="School")
class_name = fields.Char(string="Class")
course = fields.Char(string="Course") course = fields.Char(string="Course")
session = fields.Char(string="Session") session = fields.Char(string="Session")
academic_year = fields.Char(string="Academic Year") academic_year = fields.Char(string="Academic Year")
@ -34,14 +52,7 @@ class SchoolEnrollment(models.Model):
course_id = fields.Many2one('school.course', string='Course', ondelete='cascade', required=True) course_id = fields.Many2one('school.course', string='Course', ondelete='cascade', required=True)
student_id = fields.Many2one('res.partner', string='Student', required=True) student_id = fields.Many2one('res.partner', string='Student', required=True)
def action_send_message(self): @api.depends('application_id')
for record in self: def _compute_student_id(self):
raise UserError("Send Message clicked for %s" % record.name) for rec in self:
rec.student_id = str(rec.application_id.id) if rec.application_id else ''
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

@ -6,6 +6,7 @@ class EnrollmentFeeSummary(models.Model):
_description = 'Fee Summary Line' _description = 'Fee Summary Line'
enrollment_id = fields.Many2one('school.enrollment', string="Enrollment") enrollment_id = fields.Many2one('school.enrollment', string="Enrollment")
student_ref = fields.Many2one('school.student', string="Student")
total_fees = fields.Float(string="Total Fees") total_fees = fields.Float(string="Total Fees")
paid_fees = fields.Float(string="Paid Fees") paid_fees = fields.Float(string="Paid Fees")
fee_slip_amount = fields.Float(string="Fee Slip Amount") fee_slip_amount = fields.Float(string="Fee Slip Amount")

View File

@ -8,7 +8,21 @@ class EnrollmentSubject(models.Model):
enrollment_id = fields.Many2one('school.enrollment', string="Enrollment") enrollment_id = fields.Many2one('school.enrollment', string="Enrollment")
subject_id = fields.Many2one('school.subject', string="Subject Name", required=True) subject_id = fields.Many2one('school.subject', string="Subject Name", required=True)
subject_name = fields.Char(string="Subject Name") subject_name = fields.Char(string="Subject Name")
class_name = fields.Char(string="Class") 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'),
], string="Class", required=True)
academic_year = fields.Char(string="Academic Year") academic_year = fields.Char(string="Academic Year")
status = fields.Selection([ status = fields.Selection([
('active', 'Active'), ('active', 'Active'),

8
models/fee_element.py Normal file
View File

@ -0,0 +1,8 @@
from odoo import models, fields
class FeeElement(models.Model):
_name = 'school.fee.element'
_description = 'Fee Element'
name = fields.Char("Fee Component", required=True)
description = fields.Text("Description")

66
models/fee_structure.py Normal file
View File

@ -0,0 +1,66 @@
from odoo import models, fields, api
class SchoolFeeStructure(models.Model):
_name = 'school.fee.structure'
_description = 'Fee Structure'
name = fields.Char(string="Structure Name", compute='_compute_name', 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'),
], string="Class", required=True)
tuition_fee = fields.Float(string="Tuition Fees")
admission_fee = fields.Float(string="Admission Charges")
annual_charge = fields.Float(string="Annual Charges")
total_fee = fields.Float(string="Total Fee", compute="_compute_total_fee", store=True)
component_line_ids = fields.One2many('school.fee.component', 'structure_id', string="Fee Components", readonly=True)
@api.depends('class_name')
def _compute_name(self):
for rec in self:
rec.name = f"Fee Structure for Class {rec.class_name}" if rec.class_name else ""
@api.depends('tuition_fee', 'admission_fee', 'annual_charge')
def _compute_total_fee(self):
for rec in self:
rec.total_fee = (rec.tuition_fee or 0) + (rec.admission_fee or 0) + (rec.annual_charge or 0)
@api.onchange('class_name')
def _onchange_class_name(self):
fee_data = {
'1': {'admission_fee': 5000, 'tuition_fee': 72000, 'annual_charge': 1000},
'2': {'admission_fee': 6000, 'tuition_fee': 84000, 'annual_charge': 1000},
'3': {'admission_fee': 6500, 'tuition_fee': 90000, 'annual_charge': 1000},
'4': {'admission_fee': 7000, 'tuition_fee': 96000, 'annual_charge': 1000},
'5': {'admission_fee': 7500, 'tuition_fee': 100000, 'annual_charge': 1000},
'6': {'admission_fee': 8000, 'tuition_fee': 105000, 'annual_charge': 1000},
'7': {'admission_fee': 8500, 'tuition_fee': 110000, 'annual_charge': 1000},
'8': {'admission_fee': 9000, 'tuition_fee': 115000, 'annual_charge': 1000},
'9': {'admission_fee': 9500, 'tuition_fee': 120000, 'annual_charge': 1000},
'10': {'admission_fee': 10000, 'tuition_fee': 125000, 'annual_charge': 1000},
'11': {'admission_fee': 11000, 'tuition_fee': 130000, 'annual_charge': 1000},
'12': {'admission_fee': 12000, 'tuition_fee': 135000, 'annual_charge': 1000},
}
if self.class_name:
values = fee_data.get(self.class_name, {})
self.admission_fee = values.get('admission_fee', 0)
self.tuition_fee = values.get('tuition_fee', 0)
self.annual_charge = values.get('annual_charge', 0)
self.component_line_ids = [(5, 0, 0)] # Clear
self.component_line_ids = [(0, 0, {'component_name': 'Admission Charges', 'amount': self.admission_fee}),
(0, 0, {'component_name': 'Tuition Fees', 'amount': self.tuition_fee}),
(0, 0, {'component_name': 'Annual Charges', 'amount': self.annual_charge})]

View File

@ -1,12 +1,27 @@
from odoo import models, fields from odoo import models, fields
from odoo.exceptions import UserError from odoo.exceptions import UserError
_inherit = ['mail.thread', 'mail.activity.mixin']
class SchoolClassSchedule(models.Model): class SchoolClassSchedule(models.Model):
_name = 'school.class.schedule' _name = 'school.class.schedule'
_description = 'Class Schedule' _description = 'Class Schedule'
title = fields.Char(string="Title", required=True) title = fields.Char(string="Title", required=True)
class_name = fields.Char(string="Class") 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'),
], string="Class", required=True)
subject = fields.Char(string="Subject") subject = fields.Char(string="Subject")
teacher = fields.Char(string="Teacher") teacher = fields.Char(string="Teacher")
secondary_teacher = fields.Char(string="Secondary Teacher") secondary_teacher = fields.Char(string="Secondary Teacher")

View File

@ -1,25 +1,52 @@
from odoo import models, fields from odoo import models, fields, api
from odoo.exceptions import UserError
import base64
class SchoolClass(models.Model): class SchoolClass(models.Model):
_name = 'school.class' _name = 'school.class'
_description = 'Class' _description = 'Class'
name = fields.Char(string='Class Name', required=True) related_subject_ids = fields.One2many('school.subject', 'class_name', string='Subjects')
name = fields.Selection([
('Class 1', 'Class 1'),
('Class 2', 'Class 2'),
('Class 3', 'Class 3'),
('Class 4', 'Class 4'),
('Class 5', 'Class 5'),
('Class 6', 'Class 6'),
('Class 7', 'Class 7'),
('Class 8', 'Class 8'),
('Class 9', 'Class 9'),
('Class 10', 'Class 10'),
('Class 11', 'Class 11'),
('Class 12', 'Class 12'),
], string="Class Name", required=True)
subject_ids = fields.Many2many('school.subject', string='Subjects') subject_ids = fields.Many2many('school.subject', string='Subjects')
school = fields.Char(string='School') school = fields.Many2one('res.company', string="School", default=lambda self: self.env.company)
is_optional = fields.Boolean(string='Optional') is_optional = fields.Boolean(string='Optional')
class_teacher = fields.Many2one('res.users', string='Class Teacher') class_teacher = fields.Many2one('res.users', string='Class Teacher')
def action_send_message(self):
for record in self:
raise UserError("Send Message clicked for %s" % record.name)
def action_log_note(self): @api.onchange('name')
for record in self: def _onchange_name_set_subjects(self):
raise UserError("Log Note clicked for %s" % record.name) if not self.name:
self.subject_ids = False
return
subject_map = {
'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'],
}
subject_codes = subject_map.get(self.name, [])
subjects = self.env['school.subject'].search([('name', 'in', subject_codes)])
self.subject_ids = [(6, 0, subjects.ids)] # This sets all
def action_schedule_activity(self):
for record in self:
raise UserError("Activity clicked for %s" % record.name)

View File

@ -1,14 +1,15 @@
from odoo import models, fields from odoo import models, fields
from odoo.exceptions import UserError
class SchoolCourse(models.Model): class SchoolCourse(models.Model):
_name = 'school.course' _name = 'school.course'
_description = 'Course' _description = 'Course'
application_id = fields.Many2one('school.application', string="Student", required=True)
name = fields.Char(string='Course Name', required=True) name = fields.Char(string='Course Name', required=True)
class_id = fields.Many2one('school.class', string='Class') class_id = fields.Many2one('school.class', string='Class')
teacher = fields.Many2one('res.users', string='Teacher') teacher = fields.Many2one('res.users', string='Teacher')
student_name = fields.Char(related='application_id.name', string="Student Name", store=True)
start_date = fields.Date(string='Started On') start_date = fields.Date(string='Started On')
end_date = fields.Date(string='End Date') end_date = fields.Date(string='End Date')
total_capacity = fields.Integer(string='Total Capacity') total_capacity = fields.Integer(string='Total Capacity')
@ -21,14 +22,4 @@ class SchoolCourse(models.Model):
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,25 +1,15 @@
from odoo import models, fields from odoo import models, fields
from odoo.exceptions import UserError
class SchoolCourseAttendance(models.Model): class SchoolCourseAttendance(models.Model):
_name = 'school.course.attendance' _name = 'school.course.attendance'
_description = 'Course Attendance' _description = 'Course Attendance'
application_id = fields.Many2one('school.application', string="Student", required=True)
course_id = fields.Many2one('school.course', string='Course', ondelete='cascade') course_id = fields.Many2one('school.course', string='Course', ondelete='cascade')
student_id = fields.Many2one('res.partner', string='Student') student_name = fields.Char(related='application_id.name', string="Student Name", store=True)
is_present = fields.Boolean(string='Present') is_present = fields.Boolean(string='Present')
class_id = fields.Many2one('school.class', string='Class') class_id = fields.Many2one('school.class', string='Class')
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,6 @@
from odoo import models, fields from odoo import models, fields
from odoo.exceptions import UserError from odoo.exceptions import UserError
_inherit = ['mail.thread', 'mail.activity.mixin']
class SchoolCourseSchedule(models.Model): class SchoolCourseSchedule(models.Model):
_name = 'school.course.schedule' _name = 'school.course.schedule'

View File

@ -3,6 +3,8 @@ from odoo import models, fields
class SchoolCourseStudent(models.Model): class SchoolCourseStudent(models.Model):
_name = 'school.course.student' _name = 'school.course.student'
_description = 'Enrolled Student' _description = 'Enrolled Student'
application_id = fields.Many2one('school.application', string="Student", required=True)
course_id = fields.Many2one('school.course', string='Course', ondelete='cascade') course_id = fields.Many2one('school.course', string='Course', ondelete='cascade')
student_id = fields.Many2one('res.partner', string='Student') student_id = fields.Many2one('res.partner', string='Student')
student_name = fields.Char(related='application_id.name', string="Student Name", store=True)

View File

@ -0,0 +1,10 @@
from odoo import models, fields, api
class SchoolFeeComponent(models.Model):
_name = 'school.fee.component'
_description = 'Fee Component'
structure_id = fields.Many2one('school.fee.structure', string="Fee Structure")
component_name = fields.Char(string="Component")
amount = fields.Float(string="Amount")

52
models/school_student.py Normal file
View File

@ -0,0 +1,52 @@
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_name = fields.Char(related='application_id.name', string="Student Name", store=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'),
], string="Class", required=True)
academic_year = fields.Char(string="Academic Year")
session_status = fields.Selection([
('active', 'Active'),
('completed', 'Completed'),
('suspended', 'Suspended')
], string="Session Status")
payment_term = fields.Char(string="Payment Term")
def action_generate_payment_slip(self):
return {
'type': 'ir.actions.act_window',
'name': 'Fee Slip',
'res_model': 'school.enrollment.fee.summary',
'view_mode': 'tree,form',
'domain': [('student_ref', '=', self.id)],
'target': 'current',
}
@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 ''

View File

@ -1,27 +1,87 @@
from odoo import models, fields from odoo import models, fields, api
from odoo.exceptions import UserError from odoo.exceptions import UserError
import base64
class SchoolSubject(models.Model): class SchoolSubject(models.Model):
_name = 'school.subject' _name = 'school.subject'
_description = 'Subject' _description = 'Subject'
name = fields.Char(string='Subject Name', required=True) name = fields.Selection([
class_id = fields.Many2one('school.class', string='Class') ('math', 'Math'),
('english', 'English'),
('science', 'Science'),
('physical_science', 'Physical Science'),
('life_science', 'Life Science'),
('geography', 'Geography'),
('history', 'History'),
('political_science', 'Political Science'),
('economic_science', 'Economic Science'),
('physics', 'Physics'),
('chemistry', 'Chemistry'),
('biology', 'Biology'),
('it', 'IT'),
('computer_science', 'Computer Science'),
('mil', 'MIL'),
('odia', 'Odia'),
('english_grammar', 'English Grammar'),
('drawing', 'Drawing'),
('odia_grammar', 'Odia Grammar'),
], string="Subject", required=True)
class_name = fields.Selection([
('Class 1', 'Class 1'),
('Class 2', 'Class 2'),
('Class 3', 'Class 3'),
('Class 4', 'Class 4'),
('Class 5', 'Class 5'),
('Class 6', 'Class 6'),
('Class 7', 'Class 7'),
('Class 8', 'Class 8'),
('Class 9', 'Class 9'),
('Class 10', 'Class 10'),
('Class 11', 'Class 11'),
('Class 12', 'Class 12'),
], string="Class Name", required=True)
lesson_plan = fields.Text(string='Lesson Plan') lesson_plan = fields.Text(string='Lesson Plan')
teacher = fields.Many2one('res.users', string='Teacher') teacher = fields.Many2one('res.users', string='Teacher')
lesson_plan_line_ids = fields.One2many('school.subject.lesson', 'subject_id', string='Lesson Plans') 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('school.subject.teacher.info', 'subject_id', string="Teacher Info")
@api.depends('class_name')
def action_send_message(self): def _compute_subjects(self):
for record in self: subject_mapping = {
raise UserError("Send Message clicked for %s" % record.name) '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.")
def action_log_note(self): existing_subjects = self.search([
for record in self: ('class_name', '=', self.class_name)
raise UserError("Log Note clicked for %s" % record.name) ]).mapped('name')
def action_schedule_activity(self): subject_list = self.get_subjects_by_class().get(self.class_name, [])
for record in self:
raise UserError("Activity clicked for %s" % record.name) new_subjects = [sub for sub in subject_list if sub not in existing_subjects]
for subject in new_subjects:
self.create({
'class_name': self.class_name,
'name': subject,
})
if not new_subjects:
raise UserError("All subjects for this class already exist.")

View File

@ -1,34 +1,34 @@
from odoo import models, fields from odoo import models, fields, api
from odoo.exceptions import UserError
class SchoolSubjectTeacherInfo(models.Model): class SchoolSubjectTeacherInfo(models.Model):
_name = 'school.subject.teacher.info' _name = 'school.subject.teacher.info'
_description = 'Subject Teacher Info' _description = 'Subject Teacher Info'
subject_id = fields.Many2one('school.subject', string='Subject', required=True, ondelete='cascade') subject_id = fields.Many2one('school.subject', string='Subject', required=True, ondelete='cascade')
employee_name = fields.Char(string='Teacher Name')
phone = fields.Char(string='Phone') # Related fields to auto-fetch from related subject's teacher (res.users)
email = fields.Char(string='Email') 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
activity = fields.Char(string='Activity') activity = fields.Char(string='Activity')
activity_deadline = fields.Date(string='New Activity Deadline') activity_deadline = fields.Date(string='New Activity Deadline')
department = fields.Char(string='Department') department = fields.Char(string='Department')
job_position = fields.Char(string='Job Position') job_position = fields.Char(string='Job Position')
manager = fields.Char(string='Manager') manager = fields.Char(string='Manager')
profile_photo = fields.Binary(string="Profile Photo", attachment=True)
address = fields.Text(string="Address") address = fields.Text(string="Address")
experience = fields.Integer(string="Experience (Years)") experience = fields.Integer(string="Experience (Years)")
date_of_birth = fields.Date(string="Date of Birth") date_of_birth = fields.Date(string="Date of Birth")
join_date = fields.Date(string="Join Date") join_date = fields.Date(string="Join Date")
def action_send_message(self):
for record in self:
raise UserError("Send Message clicked for %s" % record.employee_name)
def action_log_note(self):
for record in self:
raise UserError("Log Note clicked for %s" % record.employee_name)
def action_schedule_activity(self):
for record in self:
raise UserError("Activity clicked for %s" % record.employee_name)
@api.depends('subject_id.teacher')
def _compute_teacher_fields(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

View File

@ -6,7 +6,7 @@ class TeacherAttendance(models.Model):
_description = 'Teacher Attendance' _description = 'Teacher Attendance'
_order = 'date desc' _order = 'date desc'
teacher_id = fields.Many2one('school.subject.teacher.info', string='Teacher', required=True) teacher_id = fields.Many2one('res.partner', string='Student')
date = fields.Date(string='Date', required=True, default=fields.Date.today) date = fields.Date(string='Date', required=True, default=fields.Date.today)
attendance_status = fields.Selection([ attendance_status = fields.Selection([
('present', 'Present'), ('present', 'Present'),

View File

@ -22,4 +22,9 @@ access_school_config_settings,School Config Settings,model_school_config_setting
access_school_fees_report,Fees Report,model_school_fees_report,,1,1,1,1 access_school_fees_report,Fees Report,model_school_fees_report,,1,1,1,1
access_school_transcript_report,Transcript Report,model_school_transcript_report,,1,1,1,1 access_school_transcript_report,Transcript Report,model_school_transcript_report,,1,1,1,1
access_school_scholarship_report,Scholarship Report,model_school_scholarship_report,,1,1,1,1 access_school_scholarship_report,Scholarship Report,model_school_scholarship_report,,1,1,1,1
access_school_report_card,Report Card,model_school_report_card,,1,1,1,1 access_school_report_card,Report Card,model_school_report_card,,1,1,1,1
access_school_student,Student,model_school_student,,1,1,1,1
access_school_fee_structure,School Fee Structure,model_school_fee_structure,,1,1,1,1
access_school_fee_element,School Fee Element,model_school_fee_element,,1,1,1,1
access_school_fee_component,School Fee Component,model_school_fee_component,,1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
22 access_school_fees_report Fees Report model_school_fees_report 1 1 1 1
23 access_school_transcript_report Transcript Report model_school_transcript_report 1 1 1 1
24 access_school_scholarship_report Scholarship Report model_school_scholarship_report 1 1 1 1
25 access_school_report_card Report Card model_school_report_card 1 1 1 1
26 access_school_student Student model_school_student 1 1 1 1
27 access_school_fee_structure School Fee Structure model_school_fee_structure 1 1 1 1
28 access_school_fee_element School Fee Element model_school_fee_element 1 1 1 1
29 access_school_fee_component School Fee Component model_school_fee_component 1 0 0 0
30

View File

@ -24,12 +24,6 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<form> <form>
<sheet> <sheet>
<!-- <div class="oe_title">
<h1>
<field name="name"/>
</h1>
</div> -->
<!-- Profile Photo --> <!-- Profile Photo -->
<div class="oe_avatar"> <div class="oe_avatar">
<field name="image" widget="image" class="oe_avatar"/> <field name="image" widget="image" class="oe_avatar"/>
@ -54,6 +48,12 @@
<field name="caste"/> <field name="caste"/>
<field name="status"/> <field name="status"/>
</group> </group>
<group>
<button name="action_show_id_card"
string="Show ID Card"
type="object"
class="btn-primary"/>
</group>
</group> </group>
<notebook> <notebook>
@ -89,10 +89,30 @@
</group> </group>
</page> </page>
</notebook> </notebook>
<div class="oe_button_box d-flex" name="custom_buttons" style="margin: 10px 0; gap: 10px;"> </sheet>
<button type="object" name="action_send_message" class="btn btn-primary" string="Send Message"/> </form>
<button type="object" name="action_log_note" class="btn btn-secondary" string="Log Note"/> </field>
<button type="object" name="action_schedule_activity" class="btn btn-info" string="Activity"/> </record>
<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>
<field name="arch" type="xml">
<form string="Student ID Card">
<sheet>
<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;"/>
</div>
<div style="margin-left: 20px;">
<h2 style="margin-bottom: 10px;"><field name="name" readonly="1"/></h2>
<p><strong>School:</strong> <field name="school_name" 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>
<p><strong>DOB:</strong> <field name="date_of_birth" readonly="1"/></p>
</div>
</div> </div>
</sheet> </sheet>
</form> </form>

View File

@ -24,16 +24,17 @@
<sheet> <sheet>
<group> <group>
<field name="name"/> <field name="name"/>
<field name="subject_ids" widget="many2many_tags"/> <field name="subject_ids" widget="many2many_tags" options="{'no_create': True}"/>
<field name="school"/> <field name="school"/>
<field name="is_optional"/> <field name="is_optional"/>
<field name="class_teacher"/> <field name="class_teacher"/>
<field name="related_subject_ids">
<list>
<field name="name"/>
<field name="teacher"/>
</list>
</field>
</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> </sheet>
</form> </form>
</field> </field>

View File

@ -36,7 +36,7 @@
<page string="Attendance"> <page string="Attendance">
<field name="attendance_ids"> <field name="attendance_ids">
<list editable="bottom"> <list editable="bottom">
<field name="student_id"/> <field name="student_name"/>
<field name="is_present"/> <field name="is_present"/>
</list> </list>
</field> </field>
@ -47,7 +47,7 @@
<page string="Enrolled Students"> <page string="Enrolled Students">
<field name="enrolled_student_ids"> <field name="enrolled_student_ids">
<list editable="bottom"> <list editable="bottom">
<field name="student_id"/> <field name="student_name"/>
</list> </list>
</field> </field>
</page> </page>
@ -75,11 +75,6 @@
</field> </field>
</page> </page>
</notebook> </notebook>
<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> </sheet>
</form> </form>
</field> </field>

View File

@ -5,7 +5,7 @@
<field name="model">school.course.attendance</field> <field name="model">school.course.attendance</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<list> <list>
<field name="student_id"/> <field name="student_name"/>
<field name="class_id"/> <field name="class_id"/>
<field name="is_present"/> <field name="is_present"/>
</list> </list>
@ -19,15 +19,10 @@
<form> <form>
<sheet> <sheet>
<group> <group>
<field name="student_id"/> <field name="student_name"/>
<field name="class_id"/> <field name="class_id"/>
<field name="is_present"/> <field name="is_present"/>
</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> </sheet>
</form> </form>
</field> </field>

View File

@ -7,7 +7,7 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<list> <list>
<field name="image" widget="image" class="oe_avatar" options="{'preview_image': 'image', 'size': [40, 40]}"/> <field name="image" widget="image" class="oe_avatar" options="{'preview_image': 'image', 'size': [40, 40]}"/>
<field name="student_id"/> <field name="student_name"/>
<field name="class_name"/> <field name="class_name"/>
<field name="fees_status"/> <field name="fees_status"/>
<field name="session_status"/> <field name="session_status"/>
@ -33,8 +33,8 @@
<!-- Main Two-Column Group --> <!-- Main Two-Column Group -->
<group> <group>
<group> <group>
<field name="student_id"/> <field name="student_name"/>
<field name="school_name"/> <field name="school_id"/>
<field name="class_name"/> <field name="class_name"/>
<field name="course"/> <field name="course"/>
<field name="session"/> <field name="session"/>
@ -89,7 +89,7 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<kanban class="o_kanban_small_column"> <kanban class="o_kanban_small_column">
<!-- Declare fields used --> <!-- Declare fields used -->
<field name="student_id"/> <field name="student_name"/>
<field name="class_name"/> <field name="class_name"/>
<field name="course"/> <field name="course"/>
<field name="fees_status"/> <field name="fees_status"/>
@ -101,12 +101,12 @@
<div class="oe_kanban_global_click o_kanban_record" style="padding: 8px;"> <div class="oe_kanban_global_click o_kanban_record" style="padding: 8px;">
<!-- Top: Student Name --> <!-- Top: Student Name -->
<strong> <strong>
<field name="student_id"/> <field name="student_name"/>
</strong><br/> </strong><br/>
<!-- Info Grid --> <!-- Info Grid -->
<div style="margin-top: 8px;"> <div style="margin-top: 8px;">
<div><strong>Class:</strong> <field name="class_name"/></div> <!-- <div><strong>Class:</strong> <field name="class_name"/></div> -->
<div><strong>Course:</strong> <field name="course"/></div> <div><strong>Course:</strong> <field name="course"/></div>
<div><strong>Fees:</strong> <field name="fees_status"/></div> <div><strong>Fees:</strong> <field name="fees_status"/></div>
<div><strong>Session:</strong> <field name="session_status"/></div> <div><strong>Session:</strong> <field name="session_status"/></div>

View File

@ -0,0 +1,33 @@
<odoo>
<record id="view_fee_element_form" model="ir.ui.view">
<field name="name">fee.element.form</field>
<field name="model">school.fee.element</field>
<field name="arch" type="xml">
<form string="Fee Element">
<sheet>
<group>
<field name="name"/>
<field name="description"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="view_fee_element_list" model="ir.ui.view">
<field name="name">fee.element.list</field>
<field name="model">school.fee.element</field>
<field name="arch" type="xml">
<list>
<field name="name"/>
<field name="description"/>
</list>
</field>
</record>
<record id="action_school_fee_element" model="ir.actions.act_window">
<field name="name">Fee Element</field>
<field name="res_model">school.fee.element</field>
<field name="view_mode">list,form</field>
</record>
</odoo>

View File

@ -0,0 +1,56 @@
<odoo>
<!-- Form View -->
<record id="view_fee_structure_form" model="ir.ui.view">
<field name="name">fee.structure.form</field>
<field name="model">school.fee.structure</field>
<field name="arch" type="xml">
<form string="Fee Structure">
<sheet>
<group>
<field name="name" readonly="1"/>
<field name="class_name"/>
</group>
<group string="Fixed Fee Components">
<field name="tuition_fee" />
<field name="admission_fee" />
<field name="annual_charge" />
<field name="total_fee" />
</group>
<notebook>
<page string="Fee Components">
<field name="component_line_ids">
<list readonly="1">
<field name="component_name"/>
<field name="amount"/>
</list>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<!-- List View -->
<record id="view_fee_structure_list" model="ir.ui.view">
<field name="name">fee.structure.list</field>
<field name="model">school.fee.structure</field>
<field name="arch" type="xml">
<list string="Fee Structure">
<field name="name"/>
<field name="class_name"/>
<field name="tuition_fee"/>
<field name="admission_fee"/>
<field name="annual_charge"/>
<field name="total_fee"/>
</list>
</field>
</record>
<!-- Action -->
<record id="action_school_fee_structure" model="ir.actions.act_window">
<field name="name">Fee Structure</field>
<field name="res_model">school.fee.structure</field>
<field name="view_mode">list,form</field>
</record>
</odoo>

View File

@ -31,11 +31,6 @@
<field name="activity_count"/> <field name="activity_count"/>
</group> </group>
</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> </sheet>
</form> </form>
</field> </field>

View File

@ -12,27 +12,27 @@
name="Applications" name="Applications"
parent="menu_school_root" parent="menu_school_root"
action="action_school_application" action="action_school_application"
sequence="30"/> sequence="10"/>
<!-- Enrollment --> <!-- Enrollment -->
<menuitem id="menu_school_enrollment" <menuitem id="menu_school_enrollment"
name="Enrollment" name="Enrollment"
parent="menu_school_root" parent="menu_school_root"
action="action_school_enrollment" action="action_school_enrollment"
sequence="40"/> sequence="20"/>
<!-- Class Schedule --> <!-- Class Schedule -->
<menuitem id="menu_school_class_schedule" <menuitem id="menu_school_class_schedule"
name="Class Schedule" name="Class Schedule"
parent="menu_school_root" parent="menu_school_root"
action="action_school_class_schedule" action="action_school_class_schedule"
sequence="50"/> sequence="40"/>
<!-- Parent: Teacher Menu (no action) --> <!-- Parent: Teacher Menu (no action) -->
<menuitem id="menu_teachers_root" <menuitem id="menu_teachers_root"
name="Teacher" name="Teacher"
parent="menu_school_root" parent="menu_school_root"
sequence="20"/> sequence="30"/>
<!-- Submenu 1: All Teachers --> <!-- Submenu 1: All Teachers -->
<menuitem id="menu_teacher_all" <menuitem id="menu_teacher_all"
@ -133,11 +133,25 @@
action="action_school_config_settings" action="action_school_config_settings"
sequence="1"/> sequence="1"/>
<!-- <menuitem id="menu_teacher_main" <!-- Submenu: Fees -->
name="Teacher" <menuitem id="menu_school_configuration_fees"
parent="menu_teachers_root" name="Fees"
action="action_school_subject_teacher_info" parent="menu_school_configuration"
sequence="1"/> --> sequence="2"/>
<!-- Fee Structure Menu -->
<menuitem id="menu_school_fee_structure"
name="Fee Structure"
parent="menu_school_configuration_fees"
action="action_school_fee_structure"
sequence="1"/>
<!-- Fee Element Menu -->
<menuitem id="menu_school_fee_element"
name="Fee Element"
parent="menu_school_configuration_fees"
action="action_school_fee_element"
sequence="2"/>
<!-- Class Schedule Submenus --> <!-- Class Schedule Submenus -->
<menuitem id="menu_school_class" <menuitem id="menu_school_class"
@ -163,4 +177,5 @@
parent="menu_school_class_schedule" parent="menu_school_class_schedule"
action="action_school_course_attendance" action="action_school_course_attendance"
sequence="40"/> sequence="40"/>
</odoo> </odoo>

View File

@ -46,11 +46,6 @@
<field name="fees_status"/> <field name="fees_status"/>
</group> </group>
</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> </sheet>
</form> </form>
</field> </field>
@ -82,12 +77,34 @@
</kanban> </kanban>
</field> </field>
</record> </record>
<record id="view_school_class_schedule_activity" model="ir.ui.view">
<field name="name">school.class.schedule.activity</field>
<field name="model">school.class.schedule</field>
<field name="arch" type="xml">
<activity string="Class Schedule">
<field name="id"/>
<templates>
<t t-name="activity-box">
<div class="d-flex align-items-center">
<div>
<strong><field name="title"/></strong><br/>
<span>Class: <field name="class_name"/></span><br/>
<span>Subject: <field name="subject"/></span><br/>
<span>Teacher: <field name="teacher"/></span><br/>
</div>
</div>
</t>
</templates>
</activity>
</field>
</record>
<!-- Action Window --> <!-- Action Window -->
<record id="action_school_class_schedule" model="ir.actions.act_window"> <record id="action_school_class_schedule" model="ir.actions.act_window">
<field name="name">Class Schedule</field> <field name="name">Class Schedule</field>
<field name="res_model">school.class.schedule</field> <!-- FIXED --> <field name="res_model">school.class.schedule</field> <!-- FIXED -->
<field name="view_mode">list,form,kanban</field> <field name="view_mode">list,form,kanban,activity</field>
</record> </record>
</odoo> </odoo>

View File

@ -0,0 +1,105 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<!-- 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="school_id"/>
<field name="class_name"/>
<field name="academic_year"/>
<field name="session_status"/>
<field name="payment_term"/>
</list>
</field>
</record>
<!-- Form View -->
<record id="view_school_student_form" model="ir.ui.view">
<field name="name">school.student.form</field>
<field name="model">school.student</field>
<field name="arch" type="xml">
<form string="Student Info">
<sheet>
<h2>Student Information</h2>
<group>
<group>
<field name="profile_photo" widget="image" class="oe_avatar"
options="{'preview_image': 'profile_photo', 'size': [90, 90]}"/>
</group>
</group>
<group>
<group>
<field name="student_name"/>
<field name="application_id"/>
<field name="school_id"/>
<field name="class_name"/>
<field name="academic_year"/>
</group>
<group>
<field name="session_status"/>
<field name="payment_term"/>
<field name="enrollment_date"/>
</group>
</group>
<footer>
<button name="action_generate_payment_slip" type="object" class="btn btn-primary" string="Generate Fee Slip"/>
</footer>
</sheet>
</form>
</field>
</record>
<!-- Kanban View -->
<record id="view_school_student_kanban" model="ir.ui.view">
<field name="name">school.student.kanban</field>
<field name="model">school.student</field>
<field name="arch" type="xml">
<kanban>
<field name="profile_photo"/>
<field name="student_name"/>
<field name="class_name"/>
<templates>
<t t-name="kanban-box">
<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'}" />
</div>
<div>
<strong><field name="student_id"/></strong><br/>
<small>Class: <field name="class_name"/></small>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<!-- Action -->
<record id="action_school_student" model="ir.actions.act_window">
<field name="name">All Students</field>
<field name="res_model">school.student</field>
<field name="view_mode">list,form,kanban</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">Create and manage your students here.</p>
</field>
</record>
<!-- Menu: School Management > Students > All Students -->
<menuitem id="menu_school_student_root"
name="Students"
parent="menu_school_root"
sequence="75" />
<menuitem id="menu_school_all_students"
name="All Students"
parent="menu_school_student_root"
action="action_school_student"
sequence="1" />
</odoo>

View File

@ -45,11 +45,6 @@
<field name="address"/> <field name="address"/>
</group> </group>
</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> </sheet>
</form> </form>
</field> </field>

View File

@ -1,69 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<odoo> <odoo>
<!-- Server Action: Auto-Fill Subjects by Class -->
<record id="action_generate_subjects_for_class" model="ir.actions.server">
<field name="name">Generate Subjects</field>
<field name="model_id" ref="model_school_subject"/>
<field name="state">code</field>
<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)
</field>
</record>
<!-- List View -->
<record id="view_school_subject_list" model="ir.ui.view"> <record id="view_school_subject_list" model="ir.ui.view">
<field name="name">school.subject.list</field> <field name="name">school.subject.list</field>
<field name="model">school.subject</field> <field name="model">school.subject</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<list> <list string="Subjects">
<field name="name"/> <field name="name"/>
<field name="class_id"/> <field name="class_name"/>
<field name="lesson_plan"/> <field name="lesson_plan"/>
<field name="teacher"/> <field name="teacher"/>
</list> </list>
</field> </field>
</record> </record>
<!-- Form View -->
<record id="view_school_subject_form" model="ir.ui.view"> <record id="view_school_subject_form" model="ir.ui.view">
<field name="name">school.subject.form</field> <field name="name">school.subject.form</field>
<field name="model">school.subject</field> <field name="model">school.subject</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form> <form string="Subject">
<header>
<button name="action_generate_subjects"
string="Auto Fill Subjects"
type="object"
class="btn-primary"/>
</header>
<sheet> <sheet>
<group> <group>
<field name="name"/> <field name="name"/>
<field name="class_id"/> <field name="class_name"/>
<field name="lesson_plan"/> <field name="lesson_plan"/>
<field name="teacher"/> <field name="teacher"/>
</group> </group>
<notebook> <notebook>
<!-- TAB 1: Lesson Plan -->
<page string="Lesson Plan">
<field name="lesson_plan_line_ids">
<list editable="bottom">
<field name="title"/>
<field name="prepared_by"/>
</list>
</field>
</page>
<!-- TAB 2: Teacher Info --> <!-- TAB 1: Lesson Plan -->
<page string="Teacher"> <page string="Lesson Plan">
<field name="teacher_info_line_ids"> <field name="lesson_plan_line_ids">
<list editable="bottom"> <list editable="bottom">
<field name="employee_name"/> <field name="title"/>
<field name="phone"/> <field name="prepared_by"/>
<field name="email"/> </list>
<field name="activity"/> </field>
<field name="activity_deadline"/> </page>
<field name="department"/>
<field name="job_position"/> <!-- TAB 2: Teacher -->
<field name="manager"/> <page string="Teacher">
</list> <field name="teacher_info_line_ids">
</field> <list editable="bottom">
</page> <field name="employee_name"/>
</notebook> <field name="phone"/>
<div class="oe_button_box d-flex" name="custom_buttons" style="margin: 10px 0; gap: 10px;"> <field name="email"/>
<button type="object" name="action_send_message" class="btn btn-primary" string="Send Message"/> <field name="activity"/>
<button type="object" name="action_log_note" class="btn btn-secondary" string="Log Note"/> <field name="activity_deadline"/>
<button type="object" name="action_schedule_activity" class="btn btn-info" string="Activity"/> <field name="department"/>
</div> <field name="job_position"/>
<field name="manager"/>
</list>
</field>
</page>
</notebook>
</sheet> </sheet>
</form> </form>
</field> </field>
</record> </record>
<!-- Action -->
<record id="action_school_subject" model="ir.actions.act_window"> <record id="action_school_subject" model="ir.actions.act_window">
<field name="name">Subject</field> <field name="name">Subjects</field>
<field name="res_model">school.subject</field> <field name="res_model">school.subject</field>
<field name="view_mode">list,form</field> <field name="view_mode">list,form</field>
</record> </record>

View File

@ -31,6 +31,18 @@
</field> </field>
</record> </record>
<record id="view_teacher_attendance_calendar" model="ir.ui.view">
<field name="name">school.teacher.attendance.calendar</field>
<field name="model">school.teacher.attendance</field>
<field name="arch" type="xml">
<calendar string="Teacher Attendance Calendar" date_start="date" color="attendance_status">
<field name="teacher_id"/>
<field name="attendance_status"/>
</calendar>
</field>
</record>
<record id="action_teacher_attendance" model="ir.actions.act_window"> <record id="action_teacher_attendance" model="ir.actions.act_window">
<field name="name">Teacher Attendance</field> <field name="name">Teacher Attendance</field>
<field name="res_model">school.teacher.attendance</field> <field name="res_model">school.teacher.attendance</field>