add education module
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from . import controllers
|
||||||
|
from . import models
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
{
|
||||||
|
'name': "Education Management",
|
||||||
|
|
||||||
|
'summary': "This Module is for Education purpose",
|
||||||
|
|
||||||
|
'description': """
|
||||||
|
This Module is for Education purpose
|
||||||
|
""",
|
||||||
|
|
||||||
|
'author': "NextZen",
|
||||||
|
'website': "https://nextzenos.com",
|
||||||
|
|
||||||
|
# Categories can be used to filter modules in modules listing
|
||||||
|
# Check https://github.com/odoo/odoo/blob/15.0/odoo/addons/base/data/ir_module_category_data.xml
|
||||||
|
# for the full list
|
||||||
|
'category': 'Tutorial',
|
||||||
|
'version': '0.1',
|
||||||
|
|
||||||
|
# any module necessary for this one to work correctly
|
||||||
|
'depends': ['base'],
|
||||||
|
|
||||||
|
# always loaded
|
||||||
|
'data': [
|
||||||
|
# 'security/ir.model.access.csv',
|
||||||
|
'views/views.xml',
|
||||||
|
'views/templates.xml',
|
||||||
|
],
|
||||||
|
# only loaded in demonstration mode
|
||||||
|
'demo': [
|
||||||
|
'demo/demo.xml',
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from . import controllers
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# from odoo import http
|
||||||
|
|
||||||
|
|
||||||
|
# class Education(http.Controller):
|
||||||
|
# @http.route('/education/education', auth='public')
|
||||||
|
# def index(self, **kw):
|
||||||
|
# return "Hello, world"
|
||||||
|
|
||||||
|
# @http.route('/education/education/objects', auth='public')
|
||||||
|
# def list(self, **kw):
|
||||||
|
# return http.request.render('education.listing', {
|
||||||
|
# 'root': '/education/education',
|
||||||
|
# 'objects': http.request.env['education.education'].search([]),
|
||||||
|
# })
|
||||||
|
|
||||||
|
# @http.route('/education/education/objects/<model("education.education"):obj>', auth='public')
|
||||||
|
# def object(self, obj, **kw):
|
||||||
|
# return http.request.render('education.object', {
|
||||||
|
# 'object': obj
|
||||||
|
# })
|
||||||
|
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
<!--
|
||||||
|
<record id="object0" model="education.education">
|
||||||
|
<field name="name">Object 0</field>
|
||||||
|
<field name="value">0</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="object1" model="education.education">
|
||||||
|
<field name="name">Object 1</field>
|
||||||
|
<field name="value">10</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="object2" model="education.education">
|
||||||
|
<field name="name">Object 2</field>
|
||||||
|
<field name="value">20</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="object3" model="education.education">
|
||||||
|
<field name="name">Object 3</field>
|
||||||
|
<field name="value">30</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="object4" model="education.education">
|
||||||
|
<field name="name">Object 4</field>
|
||||||
|
<field name="value">40</field>
|
||||||
|
</record>
|
||||||
|
-->
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
@@ -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)])
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||||
|
access_education_education,education.education,model_education_education,base.group_user,1,1,1,1
|
||||||
|
@@ -0,0 +1,19 @@
|
|||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
<record id="education_class_view_list" model="ir.ui.view">
|
||||||
|
<field name="name">education.class.list</field>
|
||||||
|
<field name="model">education.class</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<list string="Class list">
|
||||||
|
<field name="name"/>
|
||||||
|
</list>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
<record id="education_class_action" model="ir.actions.act_window">
|
||||||
|
<field name="name">Class</field>
|
||||||
|
<field name="res_model">education.class</field>
|
||||||
|
<field name="view_mode">list,form</field>
|
||||||
|
</record>
|
||||||
|
<menuitem id="education_class_menu" action="education_class_action" parent="education_configuration_menu_root" sequence="10"/>
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
<!--
|
||||||
|
<template id="listing">
|
||||||
|
<ul>
|
||||||
|
<li t-foreach="objects" t-as="object">
|
||||||
|
<a t-attf-href="#{ root }/objects/#{ object.id }">
|
||||||
|
<t t-esc="object.display_name"/>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</template>
|
||||||
|
<template id="object">
|
||||||
|
<h1><t t-esc="object.display_name"/></h1>
|
||||||
|
<dl>
|
||||||
|
<t t-foreach="object._fields" t-as="field">
|
||||||
|
<dt><t t-esc="field"/></dt>
|
||||||
|
<dd><t t-esc="object[field]"/></dd>
|
||||||
|
</t>
|
||||||
|
</dl>
|
||||||
|
</template>
|
||||||
|
-->
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
Reference in New Issue
Block a user