add education module
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import education_class
|
||||
from . import education_class_group
|
||||
from . import education_student
|
||||
@@ -0,0 +1,14 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import models, fields
|
||||
|
||||
class EducationClass(models.Model):
|
||||
_name = 'education.class'
|
||||
_description = 'Education Class'
|
||||
|
||||
name = fields.Char(string='Name', required=True)
|
||||
class_group_id = fields.Many2one('education.class.group', string='Class Group', ondelete='restrict')
|
||||
next_class_id = fields.Many2one('education.class', string='Next Class')
|
||||
|
||||
attachment_ids = fields.Many2many('ir.attachment', 'education_student_ir_attachment_rel',
|
||||
'attachment_id', 'student_id', string='Attachments')
|
||||
@@ -0,0 +1,8 @@
|
||||
from odoo import fields, models
|
||||
|
||||
class EductionClassGroup(models.Model):
|
||||
_name = 'education.class.group'
|
||||
_description = 'Education Class Group'
|
||||
_order = 'sequence'
|
||||
|
||||
class_ids = fields.One2many('education.class', 'class_group_id', string='Class of Groups')
|
||||
@@ -0,0 +1,10 @@
|
||||
from odoo import models, fields
|
||||
class EducationStudent(models.Model):
|
||||
_name = 'education.student'
|
||||
|
||||
name = fields.Char(string="Name")
|
||||
student_code = fields.Char(string='Student Code')
|
||||
class_id = fields.Many2one('education.class', string='Class')
|
||||
|
||||
def get_student_has_class(self):
|
||||
return self.env['education.student'].search([('class_id', '!=', False)])
|
||||
Reference in New Issue
Block a user