-
Notifications
You must be signed in to change notification settings - Fork 17
[12.0][ADD] cie_infra (wip) #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 12.0
Are you sure you want to change the base?
Changes from 1 commit
b29b5f4
68d91f7
bdd43ea
6cda94d
ebef15c
5b85c7d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # -*- coding: utf-8 -*- | ||
|
|
||
| from . import controllers | ||
| from . import models | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # -*- coding: utf-8 -*- | ||
| { | ||
| 'name': "cie_infra", | ||
elioexe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| 'summary': """ | ||
| this module allows to visualize our servers throught an inventary. """, | ||
|
|
||
| 'description': """ | ||
| The purpose of this module is to visualize all the information | ||
| contains on our server. It means the datacenter, the location, | ||
| the different instance on it and finally the different module. | ||
| """, | ||
|
|
||
| 'author': "CoopItEasy/EliotVanGoethem", | ||
elioexe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 'website': "http://coopiteasy.be", | ||
|
|
||
| # Categories can be used to filter modules in modules listing | ||
| # Check https://github.com/odoo/odoo/blob/12.0/odoo/addons/base/data/ir_module_category_data.xml | ||
| # for the full list | ||
| #'category': 'Uncategorized', | ||
| #'version': '0.1', | ||
elioexe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| # any module necessary for this one to work correctly | ||
| 'depends': ['base'], | ||
|
|
||
| # always loaded | ||
| 'data': [ | ||
| 'security/cie_infra_security.xml', | ||
| 'security/ir.model.access.csv', | ||
| 'views/views.xml', | ||
| 'views/templates.xml', | ||
| ], | ||
| # only loaded in demonstration mode | ||
| #'demo': [ | ||
| # 'demo/demo.xml', | ||
| #], | ||
| } | ||
elioexe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # -*- coding: utf-8 -*- | ||
|
|
||
| from . import controllers |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # -*- coding: utf-8 -*- | ||
elioexe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| from odoo import http | ||
elioexe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # class CieInfra(http.Controller): | ||
| # @http.route('/cie_infra/cie_infra/', auth='public') | ||
| # def index(self, **kw): | ||
| # return "Hello, world" | ||
|
|
||
| # @http.route('/cie_infra/cie_infra/objects/', auth='public') | ||
| # def list(self, **kw): | ||
| # return http.request.render('cie_infra.listing', { | ||
| # 'root': '/cie_infra/cie_infra', | ||
| # 'objects': http.request.env['cie_infra.cie_infra'].search([]), | ||
| # }) | ||
|
|
||
| # @http.route('/cie_infra/cie_infra/objects/<model("cie_infra.cie_infra"):obj>/', auth='public') | ||
| # def object(self, obj, **kw): | ||
| # return http.request.render('cie_infra.object', { | ||
| # 'object': obj | ||
| # }) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <odoo> | ||
| <data> | ||
| <!-- --> | ||
| <!-- <record id="object0" model="cie_infra.cie_infra"> --> | ||
| <!-- <field name="name">Object 0</field> --> | ||
| <!-- <field name="value">0</field> --> | ||
| <!-- </record> --> | ||
| <!-- --> | ||
| <!-- <record id="object1" model="cie_infra.cie_infra"> --> | ||
| <!-- <field name="name">Object 1</field> --> | ||
| <!-- <field name="value">10</field> --> | ||
| <!-- </record> --> | ||
| <!-- --> | ||
| <!-- <record id="object2" model="cie_infra.cie_infra"> --> | ||
| <!-- <field name="name">Object 2</field> --> | ||
| <!-- <field name="value">20</field> --> | ||
| <!-- </record> --> | ||
| <!-- --> | ||
| <!-- <record id="object3" model="cie_infra.cie_infra"> --> | ||
| <!-- <field name="name">Object 3</field> --> | ||
| <!-- <field name="value">30</field> --> | ||
| <!-- </record> --> | ||
| <!-- --> | ||
| <!-- <record id="object4" model="cie_infra.cie_infra"> --> | ||
| <!-- <field name="name">Object 4</field> --> | ||
| <!-- <field name="value">40</field> --> | ||
| <!-- </record> --> | ||
| <!-- --> | ||
| </data> | ||
| </odoo> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # -*- coding: utf-8 -*- | ||
|
|
||
| from . import infra_server,infra_datacenter, infra_location, infra_instance, infra_instance_database, infra_instance_module_info,infra_instance_module, infra_server_shortname | ||
elioexe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| from odoo import models, fields | ||
|
|
||
|
|
||
| class Datacenter(models.Model): | ||
| _name = 'infra.datacenter' | ||
| _description = 'datacenter' | ||
| name = fields.Char('Datacenter', required=True) | ||
| location_id = fields.Many2one('infra.location', string='location') | ||
| server_ids = fields.One2many('infra.server', 'datacenter_id', string='Server') |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| from odoo import models, fields | ||
|
|
||
| class Instance(models.Model): | ||
| _name='infra.instance' | ||
| _description='instance' | ||
| name=fields.Char('name', required=True) | ||
| url=fields.Html('URL') | ||
| note=fields.Text('text') | ||
| server_id=fields.Many2one('infra.server', string='server') | ||
| database_ids=fields.One2many('infra.instance.database','instance_id',string='database') | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| from odoo import fields, models | ||
|
|
||
|
|
||
| class Database(models.Model): | ||
| _name='infra.instance.database' | ||
| _description='database' | ||
| name=fields.Char('name', required=True) | ||
| instance_id=fields.Many2one('infra.instance',string='instance') | ||
| installed_module_ids=fields.One2many('infra.instance.module.info','database_id',string='installed_module') | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| from odoo import fields, models | ||
|
|
||
| class Module(models.Model): | ||
| _name='infra.instance.module' | ||
| _description='module' | ||
| name=fields.Char('name',required=True) | ||
| module_info_ids=fields.One2many('infra.instance.module.info','module_id',string='module_info') | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| from odoo import fields , models | ||
|
|
||
| class Module_info(models.Model): | ||
elioexe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| _name='infra.instance.module.info' | ||
| _description='module.info' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We used to leave a empty line between |
||
| installed_version=fields.Char('installed_version',required=True) | ||
| available_version=fields.Char('available_version') | ||
| database_id=fields.Many2one('infra.instance.database',string='database') | ||
| module_id=fields.Many2one('infra.instance.module',string='module') | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| from odoo import fields, models | ||
|
|
||
| class Location(models.Model): | ||
| _name='infra.location' | ||
| _description='location' | ||
| name=fields.Char('name', required=True) | ||
| country_id=fields.Many2one('res.country', string='country') |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| from odoo import fields, models | ||
|
|
||
| class Server(models.Model): | ||
| _name = 'infra.server' | ||
| _description = 'server' | ||
| name = fields.Char('name', required=True) | ||
| ipv4 = fields.Char('ipv4', required=True) | ||
| ipv6 = fields.Char('ipv6', required=True) | ||
| datacenter_info = fields.Char('Datacenter info') | ||
| ovh_address = fields.Char('OVH\'s adress', required=True) | ||
| cie_address = fields.Char('cie adress', required=True) | ||
| note = fields.Text('text') | ||
| datacenter_id = fields.Many2one('infra.datacenter', string='Datacenter') | ||
| shortname_ids=fields.One2many('infra.server.shortname','server_id',string='shortname') | ||
| instance_ids=fields.One2many('infra.instance','server_id',string='instance') |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| from odoo import fields, models | ||
|
|
||
| class Server_shortname(models.Model): | ||
elioexe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| _name='infra.server.shortname' | ||
| _description='server.shortname' | ||
| name=fields.Char('name') | ||
| server_id=fields.Many2one('infra.server',string='server') | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <?xml version="1.0" ?> | ||
| <odoo> | ||
|
|
||
| <record id="module_cie_infra_access" model="ir.module.category"> | ||
| <field name="name">cie_infra</field> | ||
elioexe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </record> | ||
|
|
||
| <!-- cie_infra user group--> | ||
| <record id="cie_infra_usergroup" model="res.groups"> | ||
| <field name="name">User</field> | ||
| <field name="category_id" | ||
| ref="module_cie_infra_access"/> | ||
| <field name="implied_ids" | ||
| eval="[(4, ref('base.group_user'))]"/> | ||
| </record> | ||
|
|
||
| <!-- cie_infra manager group--> | ||
| <record id="cie_infra_managergroup" model="res.groups"> | ||
| <field name="name">Manager</field> | ||
| <field name="category_id" | ||
| ref="module_cie_infra_access" /> | ||
| <field name="implied_ids" | ||
| eval="[(4, ref('cie_infra.cie_infra_usergroup'))]"/> | ||
| <field name="users" | ||
| eval="[(4, ref('base.user_root')),(4, ref('base.user_admin'))]"/> | ||
| </record> | ||
|
|
||
|
|
||
|
|
||
| </odoo> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
| access_cie_infra_datacenter_user,cie_infra_datacenter_user,model_infra_datacenter,cie_infra_usergroup,1,0,0,0 | ||
| access_cie_infra_datacenter_manager,cie_infra_datacenter_manager,model_infra_datacenter,cie_infra_managergroup,1,1,1,1 | ||
| access_cie_infra_instance_user,cie_infra_instance_user,model_infra_instance,cie_infra_usergroup,1,0,0,0 | ||
| access_cie_infra_instance_manager,cie_infra_instance_manager,model_infra_instance,cie_infra_managergroup,1,1,1,1 | ||
| access_cie_infra_database_user,cie_infra_database_user,model_infra_instance_database,cie_infra_usergroup,1,0,0,0 | ||
| access_cie_infra_database_manager,cie_infra_database_manager,model_infra_instance_database,cie_infra_managergroup,1,1,1,1 | ||
| access_cie_infra_module_user,cie_infra_module_user,model_infra_instance_module,cie_infra_usergroup,1,0,0,0 | ||
| access_cie_infra_module_manager,cie_infra_module_manager,model_infra_instance_module,cie_infra_managergroup,1,1,1,1 | ||
| access_cie_infra_moduleinfo_user,cie_infra_moduleinfo_user,model_infra_instance_module_info,cie_infra_usergroup,1,0,0,0 | ||
| access_cie_infra_moduleinfo_manager,cie_infra_moduleinfo_manager,model_infra_instance_module_info,cie_infra_managergroup,1,1,1,1 | ||
| access_cie_infra_location_user,cie_infra_location_user,model_infra_location,cie_infra_usergroup,1,0,0,0 | ||
| access_cie_infra_location_manager,cie_infra_location_manager,model_infra_location,cie_infra_managergroup,1,1,1,1 | ||
| access_cie_infra_server_user,cie_infra_server_user,model_infra_server,cie_infra_usergroup,1,0,0,0 | ||
| access_cie_infra_server_manager,cie_infra_server_manager,model_infra_server,cie_infra_managergroup,1,1,1,1 | ||
| access_cie_infra_servername_user,cie_infra_servername_user,model_infra_server_shortname,cie_infra_usergroup,1,0,0,0 | ||
| access_cie_infra_servername_manager,cie_infra_servername_manager,model_infra_server_shortname,cie_infra_managergroup,1,1,1,1 | ||
|
|
||
elioexe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| <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> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| <odoo> | ||
| <data> | ||
| <!-- explicit list view definition --> | ||
elioexe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <!-- | ||
| <record model="ir.ui.view" id="cie_infra.list"> | ||
| <field name="name">cie_infra list</field> | ||
| <field name="model">cie_infra.cie_infra</field> | ||
| <field name="arch" type="xml"> | ||
| <tree> | ||
| <field name="name"/> | ||
| <field name="value"/> | ||
| <field name="value2"/> | ||
| </tree> | ||
| </field> | ||
| </record> | ||
| --> | ||
|
|
||
| <!-- actions opening views on models --> | ||
| <record model="ir.actions.act_window" id="cie_infra.action_window_server"> | ||
| <field name="name">CoopItEasy Server</field> | ||
| <field name="res_model">infra.server</field> | ||
| <field name="view_mode">tree,form</field> | ||
| </record> | ||
| <record model="ir.actions.act_window" id="cie_infra.action_window_database"> | ||
| <field name="name">CoopItEasy Database</field> | ||
| <field name="res_model">infra.instance.database</field> | ||
| <field name="view_mode">tree,form</field> | ||
| </record> | ||
| <record model="ir.actions.act_window" id="cie_infra.action_window_module"> | ||
| <field name="name">Module</field> | ||
| <field name="res_model">infra.instance.module</field> | ||
| <field name="view_mode">tree,form</field> | ||
| </record> | ||
| <record model="ir.actions.act_window" id="cie_infra.action_window_instance"> | ||
| <field name="name">Instance d'Odoo</field> | ||
| <field name="res_model">infra.instance</field> | ||
| <field name="view_mode">tree,form</field> | ||
| </record> | ||
|
|
||
|
|
||
|
|
||
| <!-- server action to the one above --> | ||
| <!-- | ||
| <record model="ir.actions.server" id="cie_infra.action_server"> | ||
| <field name="name">cie_infra server</field> | ||
| <field name="model_id" ref="model_cie_infra_cie_infra"/> | ||
| <field name="state">code</field> | ||
| <field name="code"> | ||
| action = { | ||
| "type": "ir.actions.act_window", | ||
| "view_mode": "tree,form", | ||
| "res_model": self._name, | ||
| } | ||
| </field> | ||
| </record> | ||
| --> | ||
|
|
||
| <!-- Top menu item --> | ||
|
|
||
| <menuitem name="CoopItEasy Infrastructure" id="cie_infra_menu_root"/> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here, you could change the name to |
||
|
|
||
|
|
||
| <!-- Menu item --> | ||
| <menuitem id="cie_infra.server" name="Server" parent="cie_infra_menu_root" action="cie_infra.action_window_server" /> | ||
| <menuitem name="Instance d'Odoo" id="cie_infra.instance" parent="cie_infra_menu_root" action="cie_infra.action_window_instance"/> | ||
| <menuitem name="Database" id="cie_infra.database" parent="cie_infra_menu_root" action="cie_infra.action_window_database"/> | ||
| <menuitem name="Module" id="cie_infra.module" parent="cie_infra_menu_root" action="cie_infra.action_window_module"/> | ||
|
|
||
|
|
||
| <!-- actions --> | ||
| <!-- | ||
| <menuitem name="List" id="cie_infra.menu_1_list" parent="cie_infra.menu_1" | ||
| action="cie_infra.action_window"/> | ||
| <menuitem name="Server to list" id="cie_infra" parent="cie_infra.menu_2" | ||
| action="cie_infra.action_server"/> | ||
| --> | ||
| </data> | ||
| </odoo> | ||
Uh oh!
There was an error while loading. Please reload this page.