[ADD] 0_openacademy: add new m
This commit is contained in:
		
							parent
							
								
									ae315ded4d
								
							
						
					
					
						commit
						cb98f817c5
					
				|  | @ -0,0 +1,11 @@ | ||||||
|  | <?xml version="1.0" encoding="UTF-8"?> | ||||||
|  | <projectDescription> | ||||||
|  | 	<name>zsh-autosuggestions</name> | ||||||
|  | 	<comment></comment> | ||||||
|  | 	<projects> | ||||||
|  | 	</projects> | ||||||
|  | 	<buildSpec> | ||||||
|  | 	</buildSpec> | ||||||
|  | 	<natures> | ||||||
|  | 	</natures> | ||||||
|  | </projectDescription> | ||||||
|  | @ -0,0 +1,4 @@ | ||||||
|  | # -*- coding: utf-8 -*- | ||||||
|  | 
 | ||||||
|  | # from . import controllers | ||||||
|  | from . import models | ||||||
|  | @ -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', | ||||||
|  | } | ||||||
|  | @ -0,0 +1,3 @@ | ||||||
|  | # -*- coding: utf-8 -*- | ||||||
|  | 
 | ||||||
|  | from . import controllers | ||||||
|  | @ -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/<model("0_openacademy.0_openacademy"):obj>/', auth='public') | ||||||
|  | #     def object(self, obj, **kw): | ||||||
|  | #         return http.request.render('0_openacademy.object', { | ||||||
|  | #             'object': obj | ||||||
|  | #         }) | ||||||
|  | @ -0,0 +1,14 @@ | ||||||
|  | <odoo noupdate="0"> | ||||||
|  | 	<record id="course0" model="openacademy.course"> | ||||||
|  | 		<field name="name">course 0</field> | ||||||
|  | 		<field name="description">course 0 descripton</field> | ||||||
|  | 	</record> | ||||||
|  | 	<record id="course1" model="openacademy.course"> | ||||||
|  | 		<field name="name">course 1</field> | ||||||
|  | 		<field name="description">course 1 descripton</field> | ||||||
|  | 	</record> | ||||||
|  | 	<record id="course2" model="openacademy.course"> | ||||||
|  | 		<field name="name">course 2</field> | ||||||
|  | 		<field name="description">course 2 descripton</field> | ||||||
|  | 	</record> | ||||||
|  | </odoo> | ||||||
|  | @ -0,0 +1,30 @@ | ||||||
|  | <odoo> | ||||||
|  |     <data> | ||||||
|  | <!-- | ||||||
|  |           <record id="object0" model="0_openacademy.0_openacademy"> | ||||||
|  |             <field name="name">Object 0</field> | ||||||
|  |             <field name="value">0</field> | ||||||
|  |           </record> | ||||||
|  | 
 | ||||||
|  |           <record id="object1" model="0_openacademy.0_openacademy"> | ||||||
|  |             <field name="name">Object 1</field> | ||||||
|  |             <field name="value">10</field> | ||||||
|  |           </record> | ||||||
|  | 
 | ||||||
|  |           <record id="object2" model="0_openacademy.0_openacademy"> | ||||||
|  |             <field name="name">Object 2</field> | ||||||
|  |             <field name="value">20</field> | ||||||
|  |           </record> | ||||||
|  | 
 | ||||||
|  |           <record id="object3" model="0_openacademy.0_openacademy"> | ||||||
|  |             <field name="name">Object 3</field> | ||||||
|  |             <field name="value">30</field> | ||||||
|  |           </record> | ||||||
|  | 
 | ||||||
|  |           <record id="object4" model="0_openacademy.0_openacademy"> | ||||||
|  |             <field name="name">Object 4</field> | ||||||
|  |             <field name="value">40</field> | ||||||
|  |           </record> | ||||||
|  | --> | ||||||
|  |     </data> | ||||||
|  | </odoo> | ||||||
|  | @ -0,0 +1,4 @@ | ||||||
|  | # -*- coding: utf-8 -*- | ||||||
|  | 
 | ||||||
|  | from . import openacademy_course | ||||||
|  | from . import openacademy_class | ||||||
|  | @ -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") | ||||||
|  |      | ||||||
|  |      | ||||||
|  |      | ||||||
|  |      | ||||||
|  |      | ||||||
|  | @ -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 | ||||||
|  | @ -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 | ||||||
|  | 
 | ||||||
| 
 | 
|  | @ -0,0 +1,27 @@ | ||||||
|  | <odoo> | ||||||
|  | 	<data> | ||||||
|  | 		<record id="class_add_tree_view" model="ir.ui.view"> | ||||||
|  | 			<field name="name">class_course_tree</field> | ||||||
|  | 			<field name="model">openacademy.class</field>  | ||||||
|  | 			<field name="arch" type="xml"> | ||||||
|  | 				<tree> | ||||||
|  | 					<field name="room" /> | ||||||
|  | 				</tree> | ||||||
|  | 			</field> | ||||||
|  | 		</record> | ||||||
|  | 		<!-- action window --> | ||||||
|  | 		<record id="class_add_action" model="ir.actions.act_window"> | ||||||
|  |             <field name="name">Class add</field> | ||||||
|  |             <field name="res_model">openacademy.class</field> | ||||||
|  |             <field name="view_mode">tree,form</field> | ||||||
|  |             <field name="help" type="html"> | ||||||
|  |                 <p class="o_view_nocontent_smiling_face">Create the add room class in course | ||||||
|  |                 </p> | ||||||
|  |             </field> | ||||||
|  |         </record> | ||||||
|  |          | ||||||
|  |         <menuitem id="openacademy_class_add_menu" name="add_class" parent = "openacademy_menu" | ||||||
|  |         		  action="class_add_action"/> | ||||||
|  |         		   | ||||||
|  | 	</data> | ||||||
|  | </odoo> | ||||||
|  | @ -0,0 +1,34 @@ | ||||||
|  | <odoo> | ||||||
|  |   <data> | ||||||
|  |       <!-- explicit list view definition: định nghĩa chế độ xem danh sách rõ ràng --> | ||||||
|  | 		<record id="class_course_tree_view" model="ir.ui.view"> | ||||||
|  | 			<field name="name">class_course_tree</field> | ||||||
|  | 			<field name="model">openacademy.class</field>  | ||||||
|  | 			<field name="arch" type="xml"> | ||||||
|  | 				<tree> | ||||||
|  | 					<field name="name" /> | ||||||
|  | 					<field name ="description"/> | ||||||
|  | 					<field name="room"/> | ||||||
|  | 				</tree> | ||||||
|  | 			</field> | ||||||
|  | 		</record> | ||||||
|  | 	  | ||||||
|  |     <!-- actions opening views on models : tập hợp tất cả các chế độ view --> | ||||||
|  |         <!-- | ||||||
|  |             The following tag is an action definition for a "window action", | ||||||
|  |             that is an action opening a view or a set of views, hiển thị phần view bảng | ||||||
|  |         --> | ||||||
|  |         <record id="class_list_action" model="ir.actions.act_window"> | ||||||
|  |             <field name="name">Class</field> | ||||||
|  |             <field name="res_model">openacademy.class</field> | ||||||
|  |             <field name="view_mode">tree,form</field> | ||||||
|  |             <field name="help" type="html"> | ||||||
|  |                 <p class="o_view_nocontent_smiling_face">Create the first class course | ||||||
|  |                 </p> | ||||||
|  |             </field> | ||||||
|  |         </record> | ||||||
|  |          | ||||||
|  |          <menuitem id="openacademy_class_menu" name="Class" parent = "openacademy_menu" | ||||||
|  |         		  action="class_list_action"/> | ||||||
|  |   </data> | ||||||
|  | </odoo> | ||||||
|  | @ -0,0 +1,74 @@ | ||||||
|  | <odoo> | ||||||
|  |   <data> | ||||||
|  |       <!-- explicit list view definition: định nghĩa chế độ xem danh sách rõ ràng --> | ||||||
|  | 		<record id="course_tree_view" model="ir.ui.view"> | ||||||
|  | 			<field name="name">course_tree</field> | ||||||
|  | 			<field name="model">openacademy.course</field>  <!-- phải trùng name model --> | ||||||
|  | 			<field name="arch" type="xml"> | ||||||
|  | 				<tree> | ||||||
|  | 					<field name="name" /> | ||||||
|  | 					<field name="description" /> | ||||||
|  | 					<field name="class_ids"/> | ||||||
|  | 				</tree> | ||||||
|  | 			</field> | ||||||
|  | 		</record> | ||||||
|  | 		<!-- form view --> | ||||||
|  | 		<!-- <record model="ir.ui.view" id="course_form_view"> | ||||||
|  |             <field name="name">course_form</field> | ||||||
|  |             <field name="model">openacademy.course</field> | ||||||
|  |             <field name="arch" type="xml"> | ||||||
|  |                 <form string="Course Form"> | ||||||
|  | 					<sheet> | ||||||
|  | 						<group> | ||||||
|  | 							<field name="name" /> | ||||||
|  | 						</group> | ||||||
|  | 						<notebook> | ||||||
|  | 							<page string="Description"> | ||||||
|  | 								<field name="description" /> | ||||||
|  | 							</page> | ||||||
|  | 							<page string="About"> | ||||||
|  | 								This is an example of notebooks | ||||||
|  | 							</page> | ||||||
|  | 						</notebook> | ||||||
|  | 					</sheet> | ||||||
|  |                 </form> | ||||||
|  |             </field> | ||||||
|  |         </record> --> | ||||||
|  |         <!-- search view --> | ||||||
|  | 		<record id="course_search_view" model="ir.ui.view"> | ||||||
|  | 			<field name="name">course_search</field> | ||||||
|  | 			<field name="model">openacademy.course</field> | ||||||
|  | 			<field name="arch" type="xml"> | ||||||
|  | 				<search> | ||||||
|  | 					<field name="name" /> | ||||||
|  | 					<field name="description" /> | ||||||
|  | 				</search> | ||||||
|  | 			</field> | ||||||
|  | 		</record> | ||||||
|  | 		 | ||||||
|  |     <!-- actions opening views on models : tập hợp tất cả các chế độ view --> | ||||||
|  |         <!-- | ||||||
|  |             The following tag is an action definition for a "window action", | ||||||
|  |             that is an action opening a view or a set of views, hiển thị phần view bảng | ||||||
|  |         --> | ||||||
|  |         <record id="course_list_action" model="ir.actions.act_window"> | ||||||
|  |             <field name="name">Courses</field> | ||||||
|  |             <field name="res_model">openacademy.course</field> | ||||||
|  |             <field name="view_mode">tree,form</field> | ||||||
|  |             <field name="help" type="html"> | ||||||
|  |                 <p class="o_view_nocontent_smiling_face">Create the first courses | ||||||
|  |                 </p> | ||||||
|  |             </field> | ||||||
|  |         </record> | ||||||
|  |          | ||||||
|  |     <!-- top level menu: no parent --> | ||||||
|  |         <menuitem id="openacademy_menu" name="Open Academy"/> | ||||||
|  |          | ||||||
|  |         <!-- the following menuitem should appear *after* | ||||||
|  |              its parent openacademy_menu and *after* its | ||||||
|  |              action course_list_action --> | ||||||
|  |         <menuitem id="courses_menu_1" name="Courses" parent="openacademy_menu" /> | ||||||
|  |         <menuitem id="course_menu_sub_1" name="Môn học" parent="courses_menu_1" action="course_list_action"/> | ||||||
|  |         <menuitem id="course_menu_sub_2" name="Năng khiếu" parent="courses_menu_1" action="course_list_action"/> | ||||||
|  |   </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> | ||||||
		Loading…
	
		Reference in New Issue