Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoPauloSouza committed May 16, 2017
0 parents commit 5f05081
Show file tree
Hide file tree
Showing 10 changed files with 193 additions and 0 deletions.
4 changes: 4 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-

from . import controllers
from . import models
35 changes: 35 additions & 0 deletions __manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
{
'name': "odoo_mautic",

'summary': """
Short (1 phrase/line) summary of the module's purpose, used as
subtitle on modules listing or apps.openerp.com""",

'description': """
Long description of module's purpose
""",

'author': "My Company",
'website': "http://www.yourcompany.com",

# Categories can be used to filter modules in modules listing
# Check https://github.com/odoo/odoo/blob/master/odoo/addons/base/module/module_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',
'views/views.xml',
'views/templates.xml',
],
# only loaded in demonstration mode
'demo': [
'demo/demo.xml',
],
}
3 changes: 3 additions & 0 deletions controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-

from . import controllers
20 changes: 20 additions & 0 deletions controllers/controllers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from odoo import http

# class OdooMautic(http.Controller):
# @http.route('/odoo_mautic/odoo_mautic/', auth='public')
# def index(self, **kw):
# return "Hello, world"

# @http.route('/odoo_mautic/odoo_mautic/objects/', auth='public')
# def list(self, **kw):
# return http.request.render('odoo_mautic.listing', {
# 'root': '/odoo_mautic/odoo_mautic',
# 'objects': http.request.env['odoo_mautic.odoo_mautic'].search([]),
# })

# @http.route('/odoo_mautic/odoo_mautic/objects/<model("odoo_mautic.odoo_mautic"):obj>/', auth='public')
# def object(self, obj, **kw):
# return http.request.render('odoo_mautic.object', {
# 'object': obj
# })
30 changes: 30 additions & 0 deletions demo/demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<odoo>
<data>
<!-- -->
<!-- <record id="object0" model="odoo_mautic.odoo_mautic"> -->
<!-- <field name="name">Object 0</field> -->
<!-- <field name="value">0</field> -->
<!-- </record> -->
<!-- -->
<!-- <record id="object1" model="odoo_mautic.odoo_mautic"> -->
<!-- <field name="name">Object 1</field> -->
<!-- <field name="value">10</field> -->
<!-- </record> -->
<!-- -->
<!-- <record id="object2" model="odoo_mautic.odoo_mautic"> -->
<!-- <field name="name">Object 2</field> -->
<!-- <field name="value">20</field> -->
<!-- </record> -->
<!-- -->
<!-- <record id="object3" model="odoo_mautic.odoo_mautic"> -->
<!-- <field name="name">Object 3</field> -->
<!-- <field name="value">30</field> -->
<!-- </record> -->
<!-- -->
<!-- <record id="object4" model="odoo_mautic.odoo_mautic"> -->
<!-- <field name="name">Object 4</field> -->
<!-- <field name="value">40</field> -->
<!-- </record> -->
<!-- -->
</data>
</odoo>
3 changes: 3 additions & 0 deletions models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-

from . import models
15 changes: 15 additions & 0 deletions models/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-

from odoo import models, fields, api

# class odoo_mautic(models.Model):
# _name = 'odoo_mautic.odoo_mautic'

# name = fields.Char()
# value = fields.Integer()
# value2 = fields.Float(compute="_value_pc", store=True)
# description = fields.Text()
#
# @api.depends('value')
# def _value_pc(self):
# self.value2 = float(self.value) / 100
2 changes: 2 additions & 0 deletions security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_odoo_mautic_odoo_mautic,odoo_mautic.odoo_mautic,model_odoo_mautic_odoo_mautic,,1,0,0,0
22 changes: 22 additions & 0 deletions views/templates.xml
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>
59 changes: 59 additions & 0 deletions views/views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<odoo>
<data>
<!-- explicit list view definition -->
<!--
<record model="ir.ui.view" id="odoo_mautic.list">
<field name="name">odoo_mautic list</field>
<field name="model">odoo_mautic.odoo_mautic</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="odoo_mautic.action_window">
<field name="name">odoo_mautic window</field>
<field name="res_model">odoo_mautic.odoo_mautic</field>
<field name="view_mode">tree,form</field>
</record>
-->

<!-- server action to the one above -->
<!--
<record model="ir.actions.server" id="odoo_mautic.action_server">
<field name="name">odoo_mautic server</field>
<field name="model_id" ref="model_odoo_mautic_odoo_mautic"/>
<field name="code">
action = {
"type": "ir.actions.act_window",
"view_mode": "tree,form",
"res_model": self._name,
}
</field>
</record>
-->

<!-- Top menu item -->
<!--
<menuitem name="odoo_mautic" id="odoo_mautic.menu_root"/>
-->
<!-- menu categories -->
<!--
<menuitem name="Menu 1" id="odoo_mautic.menu_1" parent="odoo_mautic.menu_root"/>
<menuitem name="Menu 2" id="odoo_mautic.menu_2" parent="odoo_mautic.menu_root"/>
-->
<!-- actions -->
<!--
<menuitem name="List" id="odoo_mautic.menu_1_list" parent="odoo_mautic.menu_1"
action="odoo_mautic.action_window"/>
<menuitem name="Server to list" id="odoo_mautic" parent="odoo_mautic.menu_2"
action="odoo_mautic.action_server"/>
-->
</data>
</odoo>

0 comments on commit 5f05081

Please sign in to comment.