Giter Site home page Giter Site logo

odoo / tutorials Goto Github PK

View Code? Open in Web Editor NEW
54.0 54.0 823.0 574 KB

A repository with the code for the bases and solutions of the official Odoo tutorials

Home Page: https://www.odoo.com/documentation/latest/developer/howtos.html

Python 78.49% JavaScript 21.51%

tutorials's Introduction

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

tutorials's People

Contributors

antoinevdv avatar ged-odoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tutorials's Issues

JS tutorial 2.3

the read_group is incorrect in the get_statistics function

orders_by_size = self.read_group([['state', '!=', 'cancelled']], [], ['size'])
-->
orders_by_size = self.read_group([['state', '!=', 'cancelled']], ['size', 'quantity'], ['size'])

or else it fails at this line:
'orders_by_size': {g['size']: g['quantity'] for g in orders_by_size},

[17.0] Tutorial module not working

Hi, I'm new to owl and try to learning owl in Odoo 17. there is no problem in installation, but the playground not loaded. after I'm looking what happen there is error inside my browser console, it says
image
and when I look at manifest.py

'assets': {
        'owl_playground.assets_playground': [
            # bootstrap
            ('include', 'web._assets_helpers'),
            'web/static/src/scss/pre_variables.scss',
            'web/static/lib/bootstrap/scss/_variables.scss',
            ('include', 'web._assets_bootstrap'),

            'web/static/src/libs/fontawesome/css/font-awesome.css', # required for fa icons
            'web/static/src/legacy/js/promise_extension.js', # required by boot.js
            'web/static/src/boot.js', # odoo module system
            'web/static/src/env.js', # required for services
            'web/static/src/session.js', # expose __session_info__ containing server information
            'web/static/lib/owl/owl.js', # owl library
            'web/static/lib/owl/odoo_module.js', # to be able to import "@odoo/owl"
            'web/static/src/core/utils/functions.js',
            'web/static/src/core/browser/browser.js',
            'web/static/src/core/registry.js',
            'web/static/src/core/assets.js',
            'owl_playground/static/src/**/*',
        ],
    }

I can't find promise_extension in path
image
is there any problem with my odoo 17 or they not release the newest version yet?

awesome_clicker : Always show : web.assets_web.min.js:1139 Component 'ClickerValue' does not have a static props description

Always show : web.assets_web.min.js:1139 Component 'ClickerValue' does not have a static props description Warning

And clicker_model's toJSON() method is defined but never to use, so if we use the original solution like :

 start(env, services) {
        const localState = migrate(JSON.parse(browser.localStorage.getItem("clickerState")));
        const clickerModel = localState ? ClickerModel.fromJSON(localState): new ClickerModel();

        setInterval(() => {
            browser.localStorage.setItem("clickerState", JSON.stringify(clickerModel))
        }, 10000);
        ......

will throw an error,seem like because the [this.bus] is not be delete and will conflict with migrationstep(step 20)?

Tutorial hints the memoize function on cache network call but solution uses session property

Hi there,

Whilst working through the Owl tutorial I got to a point where the tutorial hints the use of memoize function for caching network calls (https://www.odoo.com/documentation/16.0/developer/tutorials/discover_js_framework/02_odoo_web_framework.html#:~:text=route%20in%20onWillStart-,4.%20Cache%20network%20calls%2C%20create%20a%20service,-If%20you%20open).

However, the solutions makes use of odoo session property to cache the network calls for the statistics. (https://github.com/odoo/tutorials/blob/16.0-solutions/awesome_tshirt/static/src/tshirt_service.js#:~:text=%7D)%3B-,if%20(session.tshirt_statistics)%20%7B,%7D,-setInterval(async)

Can anyone help me understand this?

Uncaught Promise > Missing template: "awesome_dashboard.AwesomeDashboard" (for component "AwesomeDashboard")

I followed the tutorials in odoo official website document, in discover the JS framework , chapter 2 build a dashboard.
I cloned the source code and switch the branch: 17.0-discover-js-framework-solutions, then configure addon in odoo 17.
After install the app: Awesome Dashboard
image

it occurs the error:

OwlError: Missing template: "awesome_dashboard.AwesomeDashboard" (for component "AwesomeDashboard")
    at App.getTemplate (http://127.0.0.1:8069/web/assets/debug/web.assets_web.js:10843:27) (/web/static/lib/owl/owl.js:3268)
    at new ComponentNode (http://127.0.0.1:8069/web/assets/debug/web.assets_web.js:9931:33) (/web/static/lib/owl/owl.js:2356)
    at http://127.0.0.1:8069/web/assets/debug/web.assets_web.js:13336:28 (/web/static/lib/owl/owl.js:5761)
    at LazyComponent.template (eval at compile (http://127.0.0.1:8069/web/assets/debug/web.assets_web.js:13107:20), <anonymous>:11:27) (/web/static/lib/owl/owl.js:5532)
    at Fiber._render (http://127.0.0.1:8069/web/assets/debug/web.assets_web.js:9297:38) (/web/static/lib/owl/owl.js:1722)
    at Fiber.render (http://127.0.0.1:8069/web/assets/debug/web.assets_web.js:9289:18) (/web/static/lib/owl/owl.js:1714)
    at ComponentNode.initiateRender (http://127.0.0.1:8069/web/assets/debug/web.assets_web.js:9954:23) (/web/static/lib/owl/owl.js:2379)

and the console in devtools shows:

error_service.js:70  Error: Invalid XML template: /awesome_dashboard/static/src/dashboard/dashboard.xml 
 Opening and ending tag mismatch: CheckBox line 31 and Checkbox, line 33, column 28
Invalid XML template: /awesome_dashboard/static/src/dashboard/number_card/number_card.xml 
 XML declaration allowed only at the start of the document, line 2, column 6

    at Registry.<anonymous> (:8069/web/assets/debug/web.assets_web.js:14321:19) (/web/static/src/core/assets.js:239)
    at Registry.trigger (:8069/web/assets/debug/web.assets_web.js:7873:18) (/web/static/lib/owl/owl.js:298)
    at Registry.add (:8069/web/assets/debug/web.assets_web.js:32689:14) (/web/static/src/core/registry.js:62)
    at Object.fn (:8069/web/assets/debug/awesome_dashboard.dashboard.js:370:60) (http://127.0.0.1:8069/web/assets/debug/awesome_dashboard.dashboard.js:370)
    at ModuleLoader.startModule (:8069/web/assets/debug/web.assets_web.js:85:33) (/web/static/src/module_loader.js:80)
    at ModuleLoader.startModules (:8069/web/assets/debug/web.assets_web.js:75:22) (/web/static/src/module_loader.js:70)
    at ModuleLoader.addJob (:8069/web/assets/debug/web.assets_web.js:60:18) (/web/static/src/module_loader.js:55)
    at ModuleLoader.define (:8069/web/assets/debug/web.assets_web.js:50:22) (/web/static/src/module_loader.js:45)
    at http://127.0.0.1:8069/web/assets/debug/awesome_dashboard.dashboard.js:367:26 (:8069/web/assets/debug/awesome_dashboard.dashboard.js:367)

According the error message, I modified dashboard.xml and number_card.xml,then it runs correctly.

"How-to guides" solutions

I see that this repo contains the solutions for several projects in "Tutorials" but I can't find the solutions for the "How-to guides". Are they here? If not, do you plan to add them?

I'm trying to Create a standalone Owl application, and I'm failing so far. Maybe because sections 3 and 4 are unclear on where to put the files, or maybe for some other reasons, it's hard to tell. With a working solution, I could concentrate on coding my project instead of wondering why I kept getting a 404 on http://localhost:8069/imeka/standalone_app, or later when I found the problem AttributeError: 'Request' object has no attribute 'website'.

Blank page when accessing /owl_playground/playground route

I am following the OWL Tutorial from the Odoo documentation.
I run Odoo 17 on a python3.11 environment, and using the branch tagges "17.0" from this repository.
When I run odoo 17 with the owl_playground addon installed and want to access the route "/owl_playground/playground", I have a blank page instead of seeing the awaited "Hello World" text.

Here is the full source code of the generated html:

<html>
    <head>
        <link type="text/css" rel="stylesheet" href="[/web/assets/a43a684/owl_playground.assets_playground.min.css](view-source:http://localhost:8069/web/assets/a43a684/owl_playground.assets_playground.min.css)"/>
        <script type="text/javascript" src="[/web/assets/6cb9506/owl_playground.assets_playground.min.js](view-source:http://localhost:8069/web/assets/6cb9506/owl_playground.assets_playground.min.js)" onerror="__odooAssetError=1"></script>
    </head>

    <body>
    </body>
</html>

It shows error 'TypeError: Cannot read properties of undefined (reading 'defaultProps')' when use Layout in awesome_tshirt

I run tutorials awesome_tshirt (branch 16.0) in odoo 16, according to the 'Chapter 2: Odoo Web Framework' add Layout in dashboard component.

dashboard.js
`/** @odoo-module **/

import { Component } from "@odoo/owl";
import { registry } from "@web/core/registry";
import { Layout } from "@web/search/layout";

class AwesomeDashboard extends Component {
setup(){
this.display = {
controlPanel: { "top-right": false, "bottom-right": false },
};
}
}

AwesomeDashboard.components = { Layout };
AwesomeDashboard.template = "awesome_tshirt.clientaction";

registry.category("lazy_components").add("AwesomeDashboard", AwesomeDashboard);
dashboard.xml

<t t-name="awesome_tshirt.clientaction" owl="1">
    <Layout display="display">
        Hello
    </Layout>
</t>
`

After activated in Odoo Apps, it showed the error like below:
`UncaughtPromiseError > OwlError
Uncaught Promise > An error occured in the owl lifecycle (see this Error's "cause" property)
OwlError: An error occured in the owl lifecycle (see this Error's "cause" property)
at handleError (http://127.0.0.1:8069/web/assets/debug/web.assets_common.js:16294:35) (/web/static/lib/owl/owl.js:124)
at owl.App.handleError (http://127.0.0.1:8069/web/assets/debug/web.assets_common.js:21846:20) (/web/static/lib/owl/owl.js:5676)
at Fiber._render (http://127.0.0.1:8069/web/assets/debug/web.assets_common.js:17794:30) (/web/static/lib/owl/owl.js:1624)
at Fiber.render (http://127.0.0.1:8069/web/assets/debug/web.assets_common.js:17783:18) (/web/static/lib/owl/owl.js:1613)
at ComponentNode.initiateRender (http://127.0.0.1:8069/web/assets/debug/web.assets_common.js:18509:23) (/web/static/lib/owl/owl.js:2339)

Caused by: TypeError: Cannot read properties of undefined (reading 'defaultProps')
at new ComponentNode (http://127.0.0.1:8069/web/assets/debug/web.assets_common.js:18472:36) (/web/static/lib/owl/owl.js:2302)
at http://127.0.0.1:8069/web/assets/debug/web.assets_common.js:21837:28 (/web/static/lib/owl/owl.js:5667)
at Layout.template (eval at compile (http://127.0.0.1:8069/web/assets/debug/web.assets_common.js:21612:16), :29:27) (/web/static/lib/owl/owl.js:5442)
at Fiber._render (http://127.0.0.1:8069/web/assets/debug/web.assets_common.js:17791:38) (/web/static/lib/owl/owl.js:1621)
at Fiber.render (http://127.0.0.1:8069/web/assets/debug/web.assets_common.js:17783:18) (/web/static/lib/owl/owl.js:1613)
at ComponentNode.initiateRender (http://127.0.0.1:8069/web/assets/debug/web.assets_common.js:18509:23) (/web/static/lib/owl/owl.js:2339)

TypeError: Cannot read properties of undefined (reading 'defaultProps')`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.