Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion awesome_clicker/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
# -*- coding: utf-8 -*-
1 change: 0 additions & 1 deletion awesome_clicker/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
{
'name': "Awesome Clicker",

Expand Down
4 changes: 1 addition & 3 deletions awesome_dashboard/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# -*- coding: utf-8 -*-

from . import controllers
from . import controllers as controllers
1 change: 0 additions & 1 deletion awesome_dashboard/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
{
'name': "Awesome Dashboard",

Expand Down
4 changes: 1 addition & 3 deletions awesome_dashboard/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# -*- coding: utf-8 -*-

from . import controllers
from . import controllers as controllers
25 changes: 11 additions & 14 deletions awesome_dashboard/controllers/controllers.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# -*- coding: utf-8 -*-

import logging
import random

from odoo import http
from odoo.http import request

logger = logging.getLogger(__name__)


class AwesomeDashboard(http.Controller):
@http.route('/awesome_dashboard/statistics', type='json', auth='user')
@http.route("/awesome_dashboard/statistics", type="json", auth="user")
def get_statistics(self):
"""
Returns a dict of statistics about the orders:
Expand All @@ -22,15 +20,14 @@ def get_statistics(self):
"""

return {
'average_quantity': random.randint(4, 12),
'average_time': random.randint(4, 123),
'nb_cancelled_orders': random.randint(0, 50),
'nb_new_orders': random.randint(10, 200),
'orders_by_size': {
'm': random.randint(0, 150),
's': random.randint(0, 150),
'xl': random.randint(0, 150),
"average_quantity": random.randint(4, 12),
"average_time": random.randint(4, 123),
"nb_cancelled_orders": random.randint(0, 50),
"nb_new_orders": random.randint(10, 200),
"orders_by_size": {
"m": random.randint(0, 150),
"s": random.randint(0, 150),
"xl": random.randint(0, 150),
},
'total_amount': random.randint(100, 1000)
"total_amount": random.randint(100, 1000),
}

3 changes: 1 addition & 2 deletions awesome_gallery/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# -*- coding: utf-8 -*-
from . import models
from . import models as models
1 change: 0 additions & 1 deletion awesome_gallery/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
{
'name': "Gallery View",
'summary': """
Expand Down
5 changes: 2 additions & 3 deletions awesome_gallery/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# import filename_python_file_within_folder_or_subfolder
from . import ir_action
from . import ir_ui_view
from . import ir_action as ir_action
from . import ir_ui_view as ir_ui_view
1 change: 0 additions & 1 deletion awesome_gallery/models/ir_action.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from odoo import fields, models


Expand Down
5 changes: 2 additions & 3 deletions awesome_gallery/models/ir_ui_view.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
from odoo import fields, models


class View(models.Model):
_inherit = 'ir.ui.view'
_inherit = "ir.ui.view"

type = fields.Selection(selection_add=[('gallery', "Awesome Gallery")])
type = fields.Selection(selection_add=[("gallery", "Awesome Gallery")])
1 change: 0 additions & 1 deletion awesome_kanban/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
# -*- coding: utf-8 -*-
1 change: 0 additions & 1 deletion awesome_kanban/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
{
'name': "Awesome Kanban",
'summary': """
Expand Down
4 changes: 1 addition & 3 deletions awesome_owl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# -*- coding: utf-8 -*-

from . import controllers
from . import controllers as controllers
51 changes: 23 additions & 28 deletions awesome_owl/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,41 +1,36 @@
# -*- coding: utf-8 -*-
{
'name': "Awesome Owl",

'summary': """
"name": "Awesome Owl",
"summary": """
Starting module for "Discover the JS framework, chapter 1: Owl components"
""",

'description': """
"description": """
Starting module for "Discover the JS framework, chapter 1: Owl components"
""",

'author': "Odoo",
'website': "https://www.odoo.com",

"author": "Odoo",
"website": "https://www.odoo.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': 'Tutorials',
'version': '0.1',

"category": "Tutorials",
"version": "0.1",
# any module necessary for this one to work correctly
'depends': ['base', 'web'],
'application': True,
'installable': True,
'data': [
'views/templates.xml',
"depends": ["base", "web"],
"application": True,
"installable": True,
"data": [
"views/templates.xml",
],
'assets': {
'awesome_owl.assets_playground': [
('include', 'web._assets_helpers'),
'web/static/src/scss/pre_variables.scss',
'web/static/lib/bootstrap/scss/_variables.scss',
('include', 'web._assets_bootstrap'),
('include', 'web._assets_core'),
'web/static/src/libs/fontawesome/css/font-awesome.css',
'awesome_owl/static/src/**/*',
"assets": {
"awesome_owl.assets_playground": [
("include", "web._assets_helpers"),
"web/static/src/scss/pre_variables.scss",
"web/static/lib/bootstrap/scss/_variables.scss",
"web/static/lib/bootstrap/scss/_maps.scss",
("include", "web._assets_bootstrap"),
("include", "web._assets_core"),
"web/static/src/libs/fontawesome/css/font-awesome.css",
"awesome_owl/static/src/**/*",
],
},
'license': 'AGPL-3'
"license": "AGPL-3",
}
4 changes: 1 addition & 3 deletions awesome_owl/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# -*- coding: utf-8 -*-

from . import controllers
from . import controllers as controllers
2 changes: 1 addition & 1 deletion awesome_owl/controllers/controllers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from odoo import http
from odoo.http import request, route
from odoo.http import request

class OwlPlayground(http.Controller):
@http.route(['/awesome_owl'], type='http', auth='public')
Expand Down
7 changes: 6 additions & 1 deletion awesome_owl/static/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ const config = {
};

// Mount the Playground component when the document.body is ready
whenReady(() => mountComponent(Playground, document.body, config));
whenReady(() => {
const target = document.getElementById('app');
if (target) {
mountComponent(Playground, target, config);
}
});

12 changes: 10 additions & 2 deletions awesome_owl/static/src/playground.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import { Component } from "@odoo/owl";
import { useState, Component } from "@odoo/owl";

export class Playground extends Component {
static template = "awesome_owl.playground";
static template = "my_module.Counter";

setup() {
this.state = useState({ value: 0 });
}

increment() {
this.state.value++;
}
}
5 changes: 3 additions & 2 deletions awesome_owl/static/src/playground.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">

<t t-name="awesome_owl.playground">
<t t-name="my_module.Counter">
<div class="p-3">
hello world
<p>Counter: <t t-esc="state.value"/></p>
<button class="btn btn-primary" t-on-click="increment">Increment</button>
</div>
</t>

Expand Down
1 change: 1 addition & 0 deletions awesome_owl/views/templates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</head>

<body>
<div id="app"></div>
</body>
</html>
</template>
Expand Down
23 changes: 23 additions & 0 deletions estate/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "debug current file",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/odoo/odoo-bin",
"args": [
"--addons-path=addons,../enterprise/,../tutorials/",
"-d",
"rd-demo",
"-u",
"estate",
"--dev",
"all",
"--http-interface=127.0.0.1"
],
"console": "integratedTerminal",
"justMyCode": true
}
]
}
1 change: 1 addition & 0 deletions estate/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
18 changes: 18 additions & 0 deletions estate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "Estate",
"version": "1.0",
"author": "Joyep",
"license": "LGPL-3",
"depends": ["base"],
"data": [
"data/ir.model.access.csv",
"views/estate_property_views.xml",
"views/estate_property_type_views.xml",
"views/estate_property_tag_views.xml",
"views/estate_menus.xml",
"views/inherited_users_views.xml",
],
"installable": True,
"application": True,
"auto_install": False,
}
5 changes: 5 additions & 0 deletions estate/data/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
access_estate_property_user,Estate Property User,model_estate_property,base.group_user,1,1,1,1
access_estate_property_type_user,Estate Property Type User,model_estate_property_type,base.group_user,1,1,1,1
access_estate_property_tag_user,Estate Property Tag User,model_estate_property_tag,base.group_user,1,1,1,1
access_estate_property_offer_user,Estate Property Offer User,model_estate_property_offer,base.group_user,1,1,1,1
7 changes: 7 additions & 0 deletions estate/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from . import (
estate_property,
estate_property_offer,
estate_property_tag,
estate_property_type,
res_users,
)
Loading