I am learning OWL. I created custom module 'owl_funn'. I want to extend Component.
I want to add template to my custom Component, but I'm getting error:
Uncaught Promise > Template owl_funn.MyComponent does not exist
My component.js looks like:
/** @odoo-module **/
const { Component } = owl;
const { whenReady } = owl.utils;
class MyComponent extends Component {
};
whenReady().then(() => {
const app = new MyComponent();
app.mount(document.body);
});
MyComponent.template = 'owl_funn.MyComponent'
comp.xml looks like:
Welcome to Odoo 2
__manifest__.py looks like:
{
"name": "owl_funn",
"summary": "Provides an example module for OWL.",
"description": "Provides an example module for OWL.",
"author": "Martinez",
"website": "http://www.example.com",
"category": "Tutorials",
"depends": ["base", "web"],
"demo": [],
"data": [],
"assets": {
"web.assets_qweb": [
"owl_funn/static/src/xml/comp.xml"
],
"web.assets_backend": [
"/owl_funn/static/src/js/component.js"
]
}
}
Files in __manifest__.py are ok, because when I changed names of files in __manifest__.py then I got error that those files no exists.
I don't want to write template xml inline, because I read that it is not good practice.
Why my js file don't see xml template?
i have the same problem, any help ?