Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

Template does not exist

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
templatev15OWL
4 Antwoorden
14077 Weergaven
Avatar
jan banda

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?


0
Avatar
Annuleer
ayoub

i have the same problem, any help ?

Avatar
África Santeliz
Beste antwoord

After a lot of headaches, I finally figured out that my problem is that I hadn't given my template the owl="1" attribute in the definition.

In my case the structure would be this:

template_file.xml (Note: For some reason I can't make the xml code visible, so I've removed some symbols)


xml version="1.0" encoding="UTF-8"

template xml:space="preserve"

    t t-name="module.Component" owl="1"

       //QWEB CONTENT

    /t

/template


component_file.js


/** @odoo-module **/

const { Component } = owl;

export default class ComponentModel extends Component {
    setup() {
        super.setup(...arguments);
    }
};

ComponentModel.template = 'module.Component';


Now it only remains to properly import the files using the __manifest__.py


'assets': {
    'web.assets_qweb': [
        'module/static/src/**/*.xml',
    ],
    'web.assets_backend': [
        'module/static/src/**/*.js',
    ],
}

I hope it works for you...

3
Avatar
Annuleer
Avatar
Dharmesh Prajapati
Beste antwoord
import { getTemplate } from "@web/core/templates" ;
const app = new App(Js, { getTemplate,});
app.mount(target);
use this......
0
Avatar
Annuleer
Avatar
Elodie Meunier
Beste antwoord

Hello, I have the same issue. Did you find a solution ? Thank you.

0
Avatar
Annuleer
Avatar
Guillaume Deflaux
Beste antwoord

I am having the same issue. Any help would be much appreciated.

0
Avatar
Annuleer
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
What is the correct ORM count function to use within Odoo Owl component?
v15 Dashboard OWL
Avatar
Avatar
1
feb. 24
3446
How to extend class with Owl JS in V15? Opgelost
javascript v15 OWL
Avatar
Avatar
1
jan. 24
8953
How to load external JavaScript library asynchronously using onWillStart function in Owl?
chart v15 Dashboard OWL
Avatar
Avatar
2
dec. 23
6608
Custom Module error "@web/core/hooks" dependency missing
web dependencies v15 OWL
Avatar
0
jul. 23
122
ODOO 15 EE : export in xslx any reporting Opgelost
report template v15 xslx
Avatar
Avatar
1
feb. 23
4604
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now