my 2nd commit
This commit is contained in:
parent
19e8d93821
commit
fd6e55ccbb
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"git.ignoreLimitWarning": true
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
'name': 'School_Management',
|
||||
'version': '1.0',
|
||||
'depends': ['base', 'web', 'mail'],
|
||||
'depends': ['base', 'web', 'mail','product'],
|
||||
'license': 'LGPL-3',
|
||||
'data': [
|
||||
'security/security.xml',
|
||||
|
@ -20,8 +20,10 @@
|
|||
'views/teacher_attendance_view.xml',
|
||||
'views/school_misc_views.xml',
|
||||
'views/school_reporting_views.xml',
|
||||
'views/school_student_views.xml',
|
||||
'views/fee_structure_views.xml',
|
||||
'views/fee_element_views.xml',
|
||||
'views/menu.xml',
|
||||
|
||||
],
|
||||
'installable': True,
|
||||
'application': True,
|
||||
|
|
Binary file not shown.
|
@ -15,5 +15,11 @@ from . import school_subject_lesson
|
|||
from . import school_subject_teacher_info
|
||||
from . import teacher_attendance
|
||||
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -9,15 +9,29 @@ class SchoolApplication(models.Model):
|
|||
_description = 'Student Application'
|
||||
_order = 'name'
|
||||
_rec_name = 'name'
|
||||
|
||||
# _inherit = ['mail.thread', 'mail.activity.mixin']
|
||||
_inherit = ['mail.thread', 'mail.activity.mixin']
|
||||
|
||||
name = fields.Char(string="Student Name", required=True,)
|
||||
email = fields.Char(string="Email", )
|
||||
phone_no = fields.Char(string="Phone Number")
|
||||
image = fields.Binary("Profile Photo", store=True)
|
||||
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([
|
||||
('male', 'Male'),
|
||||
('female', 'Female'),
|
||||
|
@ -74,18 +88,31 @@ class SchoolApplication(models.Model):
|
|||
if not re.fullmatch(r'\d{10}', record.phone_no or ''):
|
||||
raise ValidationError("Phone number must contain exactly 10 digits.")
|
||||
|
||||
def action_send_message(self):
|
||||
for record in self:
|
||||
raise UserError("Send Message clicked for %s" % record.name)
|
||||
def action_show_id_card(self):
|
||||
self.ensure_one()
|
||||
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:
|
||||
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)
|
||||
@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 get_default_image(self):
|
||||
# with open('/path/to/sample.jpg', 'rb') as f:
|
||||
# return base64.b64encode(f.read())
|
|
@ -1,14 +1,32 @@
|
|||
from odoo import models, fields
|
||||
from odoo.exceptions import UserError
|
||||
from odoo import models, fields, api
|
||||
_inherit = ['mail.thread', 'mail.activity.mixin']
|
||||
|
||||
|
||||
class SchoolEnrollment(models.Model):
|
||||
_name = 'school.enrollment'
|
||||
_description = 'Enrollment'
|
||||
|
||||
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")
|
||||
|
||||
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)
|
||||
|
||||
course = fields.Char(string="Course")
|
||||
session = fields.Char(string="Session")
|
||||
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)
|
||||
student_id = fields.Many2one('res.partner', string='Student', required=True)
|
||||
|
||||
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)
|
||||
@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 ''
|
|
@ -6,6 +6,7 @@ class EnrollmentFeeSummary(models.Model):
|
|||
_description = 'Fee Summary Line'
|
||||
|
||||
enrollment_id = fields.Many2one('school.enrollment', string="Enrollment")
|
||||
student_ref = fields.Many2one('school.student', string="Student")
|
||||
total_fees = fields.Float(string="Total Fees")
|
||||
paid_fees = fields.Float(string="Paid Fees")
|
||||
fee_slip_amount = fields.Float(string="Fee Slip Amount")
|
||||
|
|
|
@ -8,7 +8,21 @@ class EnrollmentSubject(models.Model):
|
|||
enrollment_id = fields.Many2one('school.enrollment', string="Enrollment")
|
||||
subject_id = fields.Many2one('school.subject', string="Subject Name", required=True)
|
||||
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")
|
||||
status = fields.Selection([
|
||||
('active', 'Active'),
|
||||
|
|
|
@ -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")
|
|
@ -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})]
|
|
@ -1,12 +1,27 @@
|
|||
from odoo import models, fields
|
||||
from odoo.exceptions import UserError
|
||||
_inherit = ['mail.thread', 'mail.activity.mixin']
|
||||
|
||||
class SchoolClassSchedule(models.Model):
|
||||
_name = 'school.class.schedule'
|
||||
_description = 'Class Schedule'
|
||||
|
||||
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")
|
||||
teacher = fields.Char(string="Teacher")
|
||||
secondary_teacher = fields.Char(string="Secondary Teacher")
|
||||
|
|
|
@ -1,25 +1,52 @@
|
|||
from odoo import models, fields
|
||||
from odoo.exceptions import UserError
|
||||
import base64
|
||||
from odoo import models, fields, api
|
||||
|
||||
class SchoolClass(models.Model):
|
||||
_name = 'school.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')
|
||||
school = fields.Char(string='School')
|
||||
school = fields.Many2one('res.company', string="School", default=lambda self: self.env.company)
|
||||
is_optional = fields.Boolean(string='Optional')
|
||||
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)
|
||||
@api.onchange('name')
|
||||
def _onchange_name_set_subjects(self):
|
||||
if not self.name:
|
||||
self.subject_ids = False
|
||||
return
|
||||
|
||||
def action_log_note(self):
|
||||
for record in self:
|
||||
raise UserError("Log Note clicked for %s" % record.name)
|
||||
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)
|
|
@ -1,14 +1,15 @@
|
|||
from odoo import models, fields
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class SchoolCourse(models.Model):
|
||||
_name = 'school.course'
|
||||
_description = 'Course'
|
||||
|
||||
application_id = fields.Many2one('school.application', string="Student", required=True)
|
||||
name = fields.Char(string='Course Name', required=True)
|
||||
class_id = fields.Many2one('school.class', string='Class')
|
||||
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')
|
||||
end_date = fields.Date(string='End Date')
|
||||
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)
|
|
@ -1,5 +1,5 @@
|
|||
from odoo import models, fields
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -7,19 +7,9 @@ class SchoolCourseAttendance(models.Model):
|
|||
_name = 'school.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')
|
||||
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')
|
||||
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)
|
|
@ -1,5 +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'
|
||||
|
|
|
@ -4,5 +4,7 @@ class SchoolCourseStudent(models.Model):
|
|||
_name = 'school.course.student'
|
||||
_description = 'Enrolled Student'
|
||||
|
||||
application_id = fields.Many2one('school.application', string="Student", required=True)
|
||||
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)
|
|
@ -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")
|
||||
|
|
@ -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 ''
|
|
@ -1,27 +1,87 @@
|
|||
from odoo import models, fields
|
||||
from odoo import models, fields, api
|
||||
from odoo.exceptions import UserError
|
||||
import base64
|
||||
|
||||
class SchoolSubject(models.Model):
|
||||
_name = 'school.subject'
|
||||
_description = 'Subject'
|
||||
|
||||
name = fields.Char(string='Subject Name', required=True)
|
||||
class_id = fields.Many2one('school.class', string='Class')
|
||||
name = fields.Selection([
|
||||
('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')
|
||||
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")
|
||||
|
||||
@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'],
|
||||
}
|
||||
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_send_message(self):
|
||||
for record in self:
|
||||
raise UserError("Send Message clicked for %s" % record.name)
|
||||
existing_subjects = self.search([
|
||||
('class_name', '=', self.class_name)
|
||||
]).mapped('name')
|
||||
|
||||
def action_log_note(self):
|
||||
for record in self:
|
||||
raise UserError("Log Note clicked for %s" % record.name)
|
||||
subject_list = self.get_subjects_by_class().get(self.class_name, [])
|
||||
|
||||
def action_schedule_activity(self):
|
||||
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.")
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
from odoo import models, fields
|
||||
from odoo.exceptions import UserError
|
||||
from odoo import models, fields, api
|
||||
|
||||
class SchoolSubjectTeacherInfo(models.Model):
|
||||
_name = 'school.subject.teacher.info'
|
||||
_description = 'Subject Teacher Info'
|
||||
|
||||
subject_id = fields.Many2one('school.subject', string='Subject', required=True, ondelete='cascade')
|
||||
employee_name = fields.Char(string='Teacher Name')
|
||||
phone = fields.Char(string='Phone')
|
||||
email = fields.Char(string='Email')
|
||||
|
||||
# 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
|
||||
activity = fields.Char(string='Activity')
|
||||
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')
|
||||
profile_photo = fields.Binary(string="Profile Photo", attachment=True)
|
||||
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")
|
||||
|
||||
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
|
||||
|
|
|
@ -6,7 +6,7 @@ class TeacherAttendance(models.Model):
|
|||
_description = 'Teacher Attendance'
|
||||
_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)
|
||||
attendance_status = fields.Selection([
|
||||
('present', 'Present'),
|
||||
|
|
|
@ -23,3 +23,8 @@ 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_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_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
|
||||
|
||||
|
|
|
|
@ -24,12 +24,6 @@
|
|||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<sheet>
|
||||
<!-- <div class="oe_title">
|
||||
<h1>
|
||||
<field name="name"/>
|
||||
</h1>
|
||||
</div> -->
|
||||
|
||||
<!-- Profile Photo -->
|
||||
<div class="oe_avatar">
|
||||
<field name="image" widget="image" class="oe_avatar"/>
|
||||
|
@ -54,6 +48,12 @@
|
|||
<field name="caste"/>
|
||||
<field name="status"/>
|
||||
</group>
|
||||
<group>
|
||||
<button name="action_show_id_card"
|
||||
string="Show ID Card"
|
||||
type="object"
|
||||
class="btn-primary"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<notebook>
|
||||
|
@ -89,10 +89,30 @@
|
|||
</group>
|
||||
</page>
|
||||
</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"/>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</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>
|
||||
</sheet>
|
||||
</form>
|
||||
|
|
|
@ -24,16 +24,17 @@
|
|||
<sheet>
|
||||
<group>
|
||||
<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="is_optional"/>
|
||||
<field name="class_teacher"/>
|
||||
<field name="related_subject_ids">
|
||||
<list>
|
||||
<field name="name"/>
|
||||
<field name="teacher"/>
|
||||
</list>
|
||||
</field>
|
||||
</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>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<page string="Attendance">
|
||||
<field name="attendance_ids">
|
||||
<list editable="bottom">
|
||||
<field name="student_id"/>
|
||||
<field name="student_name"/>
|
||||
<field name="is_present"/>
|
||||
</list>
|
||||
</field>
|
||||
|
@ -47,7 +47,7 @@
|
|||
<page string="Enrolled Students">
|
||||
<field name="enrolled_student_ids">
|
||||
<list editable="bottom">
|
||||
<field name="student_id"/>
|
||||
<field name="student_name"/>
|
||||
</list>
|
||||
</field>
|
||||
</page>
|
||||
|
@ -75,11 +75,6 @@
|
|||
</field>
|
||||
</page>
|
||||
</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>
|
||||
</form>
|
||||
</field>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<field name="model">school.course.attendance</field>
|
||||
<field name="arch" type="xml">
|
||||
<list>
|
||||
<field name="student_id"/>
|
||||
<field name="student_name"/>
|
||||
<field name="class_id"/>
|
||||
<field name="is_present"/>
|
||||
</list>
|
||||
|
@ -19,15 +19,10 @@
|
|||
<form>
|
||||
<sheet>
|
||||
<group>
|
||||
<field name="student_id"/>
|
||||
<field name="student_name"/>
|
||||
<field name="class_id"/>
|
||||
<field name="is_present"/>
|
||||
</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>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<list>
|
||||
<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="fees_status"/>
|
||||
<field name="session_status"/>
|
||||
|
@ -33,8 +33,8 @@
|
|||
<!-- Main Two-Column Group -->
|
||||
<group>
|
||||
<group>
|
||||
<field name="student_id"/>
|
||||
<field name="school_name"/>
|
||||
<field name="student_name"/>
|
||||
<field name="school_id"/>
|
||||
<field name="class_name"/>
|
||||
<field name="course"/>
|
||||
<field name="session"/>
|
||||
|
@ -89,7 +89,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<kanban class="o_kanban_small_column">
|
||||
<!-- Declare fields used -->
|
||||
<field name="student_id"/>
|
||||
<field name="student_name"/>
|
||||
<field name="class_name"/>
|
||||
<field name="course"/>
|
||||
<field name="fees_status"/>
|
||||
|
@ -101,12 +101,12 @@
|
|||
<div class="oe_kanban_global_click o_kanban_record" style="padding: 8px;">
|
||||
<!-- Top: Student Name -->
|
||||
<strong>
|
||||
<field name="student_id"/>
|
||||
<field name="student_name"/>
|
||||
</strong><br/>
|
||||
|
||||
<!-- Info Grid -->
|
||||
<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>Fees:</strong> <field name="fees_status"/></div>
|
||||
<div><strong>Session:</strong> <field name="session_status"/></div>
|
||||
|
|
|
@ -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>
|
|
@ -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>
|
|
@ -31,11 +31,6 @@
|
|||
<field name="activity_count"/>
|
||||
</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>
|
||||
|
|
|
@ -12,27 +12,27 @@
|
|||
name="Applications"
|
||||
parent="menu_school_root"
|
||||
action="action_school_application"
|
||||
sequence="30"/>
|
||||
sequence="10"/>
|
||||
|
||||
<!-- Enrollment -->
|
||||
<menuitem id="menu_school_enrollment"
|
||||
name="Enrollment"
|
||||
parent="menu_school_root"
|
||||
action="action_school_enrollment"
|
||||
sequence="40"/>
|
||||
sequence="20"/>
|
||||
|
||||
<!-- Class Schedule -->
|
||||
<menuitem id="menu_school_class_schedule"
|
||||
name="Class Schedule"
|
||||
parent="menu_school_root"
|
||||
action="action_school_class_schedule"
|
||||
sequence="50"/>
|
||||
sequence="40"/>
|
||||
|
||||
<!-- Parent: Teacher Menu (no action) -->
|
||||
<menuitem id="menu_teachers_root"
|
||||
name="Teacher"
|
||||
parent="menu_school_root"
|
||||
sequence="20"/>
|
||||
sequence="30"/>
|
||||
|
||||
<!-- Submenu 1: All Teachers -->
|
||||
<menuitem id="menu_teacher_all"
|
||||
|
@ -133,11 +133,25 @@
|
|||
action="action_school_config_settings"
|
||||
sequence="1"/>
|
||||
|
||||
<!-- <menuitem id="menu_teacher_main"
|
||||
name="Teacher"
|
||||
parent="menu_teachers_root"
|
||||
action="action_school_subject_teacher_info"
|
||||
sequence="1"/> -->
|
||||
<!-- Submenu: Fees -->
|
||||
<menuitem id="menu_school_configuration_fees"
|
||||
name="Fees"
|
||||
parent="menu_school_configuration"
|
||||
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 -->
|
||||
<menuitem id="menu_school_class"
|
||||
|
@ -163,4 +177,5 @@
|
|||
parent="menu_school_class_schedule"
|
||||
action="action_school_course_attendance"
|
||||
sequence="40"/>
|
||||
|
||||
</odoo>
|
||||
|
|
|
@ -46,11 +46,6 @@
|
|||
<field name="fees_status"/>
|
||||
</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>
|
||||
|
@ -82,12 +77,34 @@
|
|||
</kanban>
|
||||
</field>
|
||||
</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 -->
|
||||
<record id="action_school_class_schedule" model="ir.actions.act_window">
|
||||
<field name="name">Class Schedule</field>
|
||||
<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>
|
||||
|
||||
</odoo>
|
||||
|
|
|
@ -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>
|
|
@ -45,11 +45,6 @@
|
|||
<field name="address"/>
|
||||
</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>
|
||||
|
|
|
@ -1,69 +1,87 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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">
|
||||
<field name="name">school.subject.list</field>
|
||||
<field name="model">school.subject</field>
|
||||
<field name="arch" type="xml">
|
||||
<list>
|
||||
<list string="Subjects">
|
||||
<field name="name"/>
|
||||
<field name="class_id"/>
|
||||
<field name="class_name"/>
|
||||
<field name="lesson_plan"/>
|
||||
<field name="teacher"/>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Form View -->
|
||||
<record id="view_school_subject_form" model="ir.ui.view">
|
||||
<field name="name">school.subject.form</field>
|
||||
<field name="model">school.subject</field>
|
||||
<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>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="class_id"/>
|
||||
<field name="class_name"/>
|
||||
<field name="lesson_plan"/>
|
||||
<field name="teacher"/>
|
||||
</group>
|
||||
<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 -->
|
||||
<page string="Teacher">
|
||||
<field name="teacher_info_line_ids">
|
||||
<list editable="bottom">
|
||||
<field name="employee_name"/>
|
||||
<field name="phone"/>
|
||||
<field name="email"/>
|
||||
<field name="activity"/>
|
||||
<field name="activity_deadline"/>
|
||||
<field name="department"/>
|
||||
<field name="job_position"/>
|
||||
<field name="manager"/>
|
||||
</list>
|
||||
</field>
|
||||
</page>
|
||||
</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>
|
||||
<!-- 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 -->
|
||||
<page string="Teacher">
|
||||
<field name="teacher_info_line_ids">
|
||||
<list editable="bottom">
|
||||
<field name="employee_name"/>
|
||||
<field name="phone"/>
|
||||
<field name="email"/>
|
||||
<field name="activity"/>
|
||||
<field name="activity_deadline"/>
|
||||
<field name="department"/>
|
||||
<field name="job_position"/>
|
||||
<field name="manager"/>
|
||||
</list>
|
||||
</field>
|
||||
</page>
|
||||
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Action -->
|
||||
<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="view_mode">list,form</field>
|
||||
</record>
|
||||
|
|
|
@ -31,6 +31,18 @@
|
|||
</field>
|
||||
</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">
|
||||
<field name="name">Teacher Attendance</field>
|
||||
<field name="res_model">school.teacher.attendance</field>
|
||||
|
|
Loading…
Reference in New Issue