diff --git a/.project b/.project new file mode 100644 index 0000000..64cd536 --- /dev/null +++ b/.project @@ -0,0 +1,11 @@ + + + zsh-autosuggestions + + + + + + + + diff --git a/0_openacademy/__init__.py b/0_openacademy/__init__.py new file mode 100644 index 0000000..eebdca9 --- /dev/null +++ b/0_openacademy/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- + +# from . import controllers +from . import models \ No newline at end of file diff --git a/0_openacademy/__manifest__.py b/0_openacademy/__manifest__.py new file mode 100644 index 0000000..18e5b06 --- /dev/null +++ b/0_openacademy/__manifest__.py @@ -0,0 +1,104 @@ +# -*- coding: utf-8 -*- +{ + 'name': "0_openacademy", + 'name_vi_VN': "", + + 'summary': """ +Short (1 phrase/line) summary of the module's purpose, used as +subtitle on modules listing or apps.openerp.com""", + + 'summary_vi_VN': """ +Mô tả ngắn gọn bằng tiếng Việt (1 câu, 1 dòng) về mục đích của module + """, + + 'description': """ +What it does +============ +Long description of module's purpose + +Key Features +============ +1. Feature 1 + + * Sub-Feature 1 + * Sub-Feature 2 + + * Sub-sub-feature 1 + * Sub-sub-feature 2 + +2. Feature 2 + + * Sub-Feature 1 + * Sub-Feature 2 + +Editions Supported +================== +1. Community Edition +2. Enterprise Edition + + """, + + 'description_vi_VN': """ +Ứng dụng này làm gì +=================== +Mô tả chi tiết về module + +Tính năng chính +=============== +1. Tính năng 1 + + * Tính năng Phụ 1 + * Tính năng Phụ 2 + + * Tính năng Phụ Chi tiết 1 + * Tính năng Phụ Chi tiết 2 + +2. Tính năng 2 + + * Tính năng Phụ 1 + * Tính năng Phụ 2 + +Ấn bản được Hỗ trợ +================== +1. Ấn bản Community +2. Ấn bản Enterprise + + """, + + 'author': "Viindoo", + 'website': "https://viindoo.com", + 'live_test_url': "https://v13demo-int.erponline.vn", + 'support': "apps.support@viindoo.com", + + # Categories can be used to filter modules in modules listing + # Check https://github.com/tvtma/odoo/blob/13.0/odoo/addons/base/data/ir_module_category_data.xml + # for the full list + 'category': 'Uncategorized', + 'version': '0.1', + + # any module necessary for this one to work correctly + 'depends': ['base'], + + # always loaded + 'data': [ + 'security/ir.model.access.csv', + 'data/openacademy_course_data.xml', + 'views/openacademy_course_view.xml', + 'views/openacademy_class_view.xml', + 'views/openacademy_class_add_view.xml', + # 'views/templates.xml', + ], + # only loaded in demonstration mode + 'demo': [ + # 'demo/demo.xml', + ], + 'images' : [ + # 'static/description/main_screenshot.png' + ], + 'installable': True, + 'application': False, + 'auto_install': False, + 'price': 99.9, + 'currency': 'EUR', + 'license': 'OPL-1', +} \ No newline at end of file diff --git a/0_openacademy/controllers/__init__.py b/0_openacademy/controllers/__init__.py new file mode 100644 index 0000000..457bae2 --- /dev/null +++ b/0_openacademy/controllers/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import controllers \ No newline at end of file diff --git a/0_openacademy/controllers/controllers.py b/0_openacademy/controllers/controllers.py new file mode 100644 index 0000000..e777b95 --- /dev/null +++ b/0_openacademy/controllers/controllers.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# from odoo import http + + +# class 0Openacademy(http.Controller): +# @http.route('/0_openacademy/0_openacademy/', auth='public') +# def index(self, **kw): +# return "Hello, world" + +# @http.route('/0_openacademy/0_openacademy/objects/', auth='public') +# def list(self, **kw): +# return http.request.render('0_openacademy.listing', { +# 'root': '/0_openacademy/0_openacademy', +# 'objects': http.request.env['0_openacademy.0_openacademy'].search([]), +# }) + +# @http.route('/0_openacademy/0_openacademy/objects//', auth='public') +# def object(self, obj, **kw): +# return http.request.render('0_openacademy.object', { +# 'object': obj +# }) diff --git a/0_openacademy/data/openacademy_course_data.xml b/0_openacademy/data/openacademy_course_data.xml new file mode 100644 index 0000000..29093ea --- /dev/null +++ b/0_openacademy/data/openacademy_course_data.xml @@ -0,0 +1,14 @@ + + + course 0 + course 0 descripton + + + course 1 + course 1 descripton + + + course 2 + course 2 descripton + + \ No newline at end of file diff --git a/0_openacademy/demo/demo.xml b/0_openacademy/demo/demo.xml new file mode 100644 index 0000000..b5c3558 --- /dev/null +++ b/0_openacademy/demo/demo.xml @@ -0,0 +1,30 @@ + + + + + \ No newline at end of file diff --git a/0_openacademy/models/__init__.py b/0_openacademy/models/__init__.py new file mode 100644 index 0000000..6b5c239 --- /dev/null +++ b/0_openacademy/models/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- + +from . import openacademy_course +from . import openacademy_class \ No newline at end of file diff --git a/0_openacademy/models/openacademy_class.py b/0_openacademy/models/openacademy_class.py new file mode 100644 index 0000000..4b2d862 --- /dev/null +++ b/0_openacademy/models/openacademy_class.py @@ -0,0 +1,19 @@ +from odoo import models, fields + +class OpenacademyClass(models.Model): + _name="openacademy.class" + _description = "openacademy class" + + name = fields.Char(string="Class Name",required=True) + description = fields.Text() + course_id = fields.Many2one('openacademy.course',string="course id") #string course id hiển thị trên giao diện + +class class_add(models.Model): + _name="openacademy.class" + _inherit = "openacademy.class" + room = fields.Char(string="phòng học") + + + + + \ No newline at end of file diff --git a/0_openacademy/models/openacademy_course.py b/0_openacademy/models/openacademy_course.py new file mode 100644 index 0000000..7a2c8c2 --- /dev/null +++ b/0_openacademy/models/openacademy_course.py @@ -0,0 +1,10 @@ +from odoo import models, fields + +class Course(models.Model): + _name = 'openacademy.course' #tên trên local là openacademy_course + _description = "OpenAcademy Courses" + + name = fields.Char(string="Title", required=True) + description = fields.Text() + class_ids = fields.One2many("openacademy.class","course_id",string="Class") + demo = fields.One2many diff --git a/0_openacademy/security/ir.model.access.csv b/0_openacademy/security/ir.model.access.csv new file mode 100644 index 0000000..e251ffc --- /dev/null +++ b/0_openacademy/security/ir.model.access.csv @@ -0,0 +1,4 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +id1,test,model_openacademy_course,base.group_user,1,1,1,1 +id2,test2,model_openacademy_class,base.group_user,1,1,1,1 + diff --git a/0_openacademy/views/openacademy_class_add_view.xml b/0_openacademy/views/openacademy_class_add_view.xml new file mode 100644 index 0000000..45ceb5f --- /dev/null +++ b/0_openacademy/views/openacademy_class_add_view.xml @@ -0,0 +1,27 @@ + + + + class_course_tree + openacademy.class + + + + + + + + + Class add + openacademy.class + tree,form + +

Create the add room class in course +

+
+
+ + + +
+
\ No newline at end of file diff --git a/0_openacademy/views/openacademy_class_view.xml b/0_openacademy/views/openacademy_class_view.xml new file mode 100644 index 0000000..5b71dc2 --- /dev/null +++ b/0_openacademy/views/openacademy_class_view.xml @@ -0,0 +1,34 @@ + + + + + class_course_tree + openacademy.class + + + + + + + + + + + + + Class + openacademy.class + tree,form + +

Create the first class course +

+
+
+ + +
+
\ No newline at end of file diff --git a/0_openacademy/views/openacademy_course_view.xml b/0_openacademy/views/openacademy_course_view.xml new file mode 100644 index 0000000..1504e4d --- /dev/null +++ b/0_openacademy/views/openacademy_course_view.xml @@ -0,0 +1,74 @@ + + + + + course_tree + openacademy.course + + + + + + + + + + + + + course_search + openacademy.course + + + + + + + + + + + + Courses + openacademy.course + tree,form + +

Create the first courses +

+
+
+ + + + + + + + +
+
\ No newline at end of file diff --git a/0_openacademy/views/templates.xml b/0_openacademy/views/templates.xml new file mode 100644 index 0000000..cea6b39 --- /dev/null +++ b/0_openacademy/views/templates.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file