Skip to content
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

17.0 training chha #182

Draft
wants to merge 21 commits into
base: 17.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0e7619c
[ADD] Discover the JavaScript framework
ged-odoo Oct 9, 2022
6bfaa0e
[ADD] estate: create model, security and UI
chha-odoo Oct 4, 2024
ca939cf
[IMP] estate: complted chapter 5 to 7
chha-odoo Oct 10, 2024
c6d4a28
[IMP] estate: completed chapter 8
chha-odoo Oct 11, 2024
b064c20
[IMP] estate: completed chapter 9 to 11
chha-odoo Oct 18, 2024
f24c2df
[IMP] estate: learned about python, model and view inheritance
chha-odoo Oct 21, 2024
7a0858e
[IMP] estate: auto-generate customer invoice on property sold
chha-odoo Oct 21, 2024
e50f20d
[IMP] estate: add kanban view for real estate module
chha-odoo Oct 21, 2024
e31e847
[IMP] estate: add real estate property types and demo data
chha-odoo Oct 23, 2024
16ae4de
[IMP] estate: restrict access to data for real estate module
chha-odoo Oct 24, 2024
41a9f6c
[IMP] estate: completed build pdf reports
chha-odoo Oct 25, 2024
d176606
[IMP] estate: implemented add offer functionality using wizard
chha-odoo Oct 26, 2024
a47cd34
[ADD] estate: learned about controllers
chha-odoo Nov 1, 2024
b6bea52
[FIX] estate: correct check style
chha-odoo Nov 1, 2024
46a1d6a
[ADD] stock_transport: create module for transport management system
chha-odoo Nov 4, 2024
952e9ec
[IMP] stock_transport: add graph view and gantt view
chha-odoo Nov 5, 2024
23d117a
[FIX] stock_transport: add depends and correct the check style
chha-odoo Nov 5, 2024
96c0e4c
[ADD] stock_transport: add security
chha-odoo Nov 7, 2024
de13727
[ADD] product_kit: created new module for final task
chha-odoo Nov 7, 2024
e5796d0
[IMP] product_kit: add kit functionality for sale
chha-odoo Nov 8, 2024
11b0f65
[FIX] product_kit: fix bugs of sub-products and delete functionality
chha-odoo Nov 13, 2024
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
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.languageServer": "None"
}
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Odoo tutorials

This repository hosts the code for the bases and solutions of the
[official Odoo tutorials](https://www.odoo.com/documentation/16.0/developer/howtos.html).
[official Odoo tutorials](https://www.odoo.com/documentation/master/developer/tutorials.html).

It has 2 branches for each Odoo version: one for the bases and one for
the solutions. For example, `16.0` and `16.0-solutions`. The first
It has 3 branches for each Odoo version: one for the bases, one for
[Discover the JS framework](https://www.odoo.com/documentation/master/developer/tutorials/discover_js_framework.html) solutions and one for [Master the Odoo web framework](https://www.odoo.com/documentation/master/developer/tutorials/master_odoo_web_framework.html) solutions. For example, `master` and `master-discover-js-framework-solutions` and `master-master-odoo-web-framework-solutions`. The first
contains the code of the modules that serve as base for the tutorials,
and the second contains the code of the same modules with the complete
solution.
and the others contains the code of each chapter with the complete
solution.
1 change: 1 addition & 0 deletions awesome_clicker/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# -*- coding: utf-8 -*-
29 changes: 29 additions & 0 deletions awesome_clicker/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
{
'name': "Awesome Clicker",

'summary': """
Starting module for "Master the Odoo web framework, chapter 1: Build a Clicker game"
""",

'description': """
Starting module for "Master the Odoo web framework, chapter 1: Build a Clicker game"
""",

'author': "Odoo",
'website': "https://www.odoo.com/",
'category': 'Tutorials',
'version': '0.1',
'application': True,
'installable': True,
'depends': ['base', 'web'],

'data': [],
'assets': {
'web.assets_backend': [
'awesome_clicker/static/src/**/*',
],

},
'license': 'AGPL-3'
}
3 changes: 3 additions & 0 deletions awesome_dashboard/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-

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

'summary': """
Starting module for "Discover the JS framework, chapter 2: Build a dashboard"
""",

'description': """
Starting module for "Discover the JS framework, chapter 2: Build a dashboard"
""",

'author': "Odoo",
'website': "https://www.odoo.com/",
'category': 'Tutorials',
'version': '0.1',
'application': True,
'installable': True,
'depends': ['base', 'web', 'mail', 'crm'],

'data': [
'views/views.xml',
],
'assets': {
'web.assets_backend': [
'awesome_dashboard/static/src/**/*',
],
},
'license': 'AGPL-3'
}
3 changes: 3 additions & 0 deletions awesome_dashboard/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-

from . import controllers
36 changes: 36 additions & 0 deletions awesome_dashboard/controllers/controllers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# -*- 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')
def get_statistics(self):
"""
Returns a dict of statistics about the orders:
'average_quantity': the average number of t-shirts by order
'average_time': the average time (in hours) elapsed between the
moment an order is created, and the moment is it sent
'nb_cancelled_orders': the number of cancelled orders, this month
'nb_new_orders': the number of new orders, this month
'total_amount': the total amount of orders, this month
"""

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),
},
'total_amount': random.randint(100, 1000)
}

8 changes: 8 additions & 0 deletions awesome_dashboard/static/src/dashboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Component } from "@odoo/owl";
import { registry } from "@web/core/registry";

class AwesomeDashboard extends Component {
static template = "awesome_dashboard.AwesomeDashboard";
}

registry.category("actions").add("awesome_dashboard.dashboard", AwesomeDashboard);
8 changes: 8 additions & 0 deletions awesome_dashboard/static/src/dashboard.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">

<t t-name="awesome_dashboard.AwesomeDashboard">
hello dashboard
</t>

</templates>
11 changes: 11 additions & 0 deletions awesome_dashboard/views/views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<odoo>
<data>
<record model="ir.actions.client" id="dashboard">
<field name="name">Dashboard</field>
<field name="tag">awesome_dashboard.dashboard</field>
</record>

<menuitem name="Awesome Dashboard" id="awesome_dashboard.menu_root" groups="base.group_user" web_icon="awesome_dashboard,static/description/icon.png"/>
<menuitem name="Dashboard" id="awesome_dashboard.dashboard_menu" parent="awesome_dashboard.menu_root" action="awesome_dashboard.dashboard" sequence="1"/>
</data>
</odoo>
2 changes: 2 additions & 0 deletions awesome_gallery/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from . import models
26 changes: 26 additions & 0 deletions awesome_gallery/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
{
'name': "Gallery View",
'summary': """
Starting module for "Master the Odoo web framework, chapter 3: Create a Gallery View"
""",

'description': """
Starting module for "Master the Odoo web framework, chapter 3: Create a Gallery View"
""",

'version': '0.1',
'application': True,
'category': 'Tutorials',
'installable': True,
'depends': ['web', 'contacts'],
'data': [
'views/views.xml',
],
'assets': {
'web.assets_backend': [
'awesome_gallery/static/src/**/*',
],
},
'license': 'AGPL-3'
}
4 changes: 4 additions & 0 deletions awesome_gallery/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# import filename_python_file_within_folder_or_subfolder
from . import ir_action
from . import ir_ui_view
10 changes: 10 additions & 0 deletions awesome_gallery/models/ir_action.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
from odoo import fields, models


class ActWindowView(models.Model):
_inherit = 'ir.actions.act_window.view'

view_mode = fields.Selection(selection_add=[
('gallery', "Awesome Gallery")
], ondelete={'gallery': 'cascade'})
8 changes: 8 additions & 0 deletions awesome_gallery/models/ir_ui_view.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- coding: utf-8 -*-
from odoo import fields, models


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

type = fields.Selection(selection_add=[('gallery', "Awesome Gallery")])
19 changes: 19 additions & 0 deletions awesome_gallery/views/views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="contacts.action_contacts" model="ir.actions.act_window">
<field name="name">Contacts</field>
<field name="res_model">res.partner</field>
<field name="view_mode">kanban,tree,form,activity</field>
<field name="search_view_id" ref="base.view_res_partner_filter"/>
<field name="context">{'default_is_company': True}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a Contact in your address book
</p><p>
Odoo helps you track all activities related to your contacts.
</p>
</field>
</record>
</data>
</odoo>
1 change: 1 addition & 0 deletions awesome_kanban/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# -*- coding: utf-8 -*-
26 changes: 26 additions & 0 deletions awesome_kanban/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
{
'name': "Awesome Kanban",
'summary': """
Starting module for "Master the Odoo web framework, chapter 4: Customize a kanban view"
""",

'description': """
Starting module for "Master the Odoo web framework, chapter 4: Customize a kanban view.
""",

'version': '0.1',
'application': True,
'category': 'Tutorials',
'installable': True,
'depends': ['web', 'crm'],
'data': [
'views/views.xml',
],
'assets': {
'web.assets_backend': [
'awesome_kanban/static/src/**/*',
],
},
'license': 'AGPL-3'
}
1 change: 1 addition & 0 deletions awesome_kanban/static/src/awesome_kanban_view.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// TODO: Define here your AwesomeKanban view
15 changes: 15 additions & 0 deletions awesome_kanban/views/views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="crm_lead_kanban_inherited" model="ir.ui.view">
<field name="name">crm.lead.kanban.lead.awesome_gallery</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_case_kanban_view_leads"/>
<field name="arch" type="xml">
<xpath expr="//kanban" position="attributes">
<attribute name="js_class">awesome_kanban</attribute>
</xpath>
</field>
</record>
</data>
</odoo>
3 changes: 3 additions & 0 deletions awesome_owl/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-

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

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

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

'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',

# any module necessary for this one to work correctly
'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/**/*',
],
},
'license': 'AGPL-3'
}
3 changes: 3 additions & 0 deletions awesome_owl/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-

from . import controllers
10 changes: 10 additions & 0 deletions awesome_owl/controllers/controllers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from odoo import http
from odoo.http import request, route

class OwlPlayground(http.Controller):
@http.route(['/awesome_owl'], type='http', auth='public')
def show_playground(self):
"""
Renders the owl playground page
"""
return request.render('awesome_owl.playground')
12 changes: 12 additions & 0 deletions awesome_owl/static/src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { whenReady } from "@odoo/owl";
import { mountComponent } from "@web/env";
import { Playground } from "./playground";

const config = {
dev: true,
name: "Owl Tutorial"
};

// Mount the Playground component when the document.body is ready
whenReady(() => mountComponent(Playground, document.body, config));

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

export class Playground extends Component {
static template = "awesome_owl.playground";
}
10 changes: 10 additions & 0 deletions awesome_owl/static/src/playground.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">

<t t-name="awesome_owl.playground">
<div class="p-3">
hello world
</div>
</t>

</templates>
15 changes: 15 additions & 0 deletions awesome_owl/views/templates.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<odoo>
<data>
<template id="awesome_owl.playground" name="Awesome T-Shirt thank you">
<html>
<head>
<link type="image/x-icon" rel="shortcut icon" href="/web/static/img/favicon.ico"/>
<t t-call-assets="awesome_owl.assets_playground"/>
</head>

<body>
</body>
</html>
</template>
</data>
</odoo>
3 changes: 3 additions & 0 deletions estate/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import models
from . import wizard
from . import controllers
Loading