Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

Template does not exist

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
templatev15OWL
4 Replies
14049 Tampilan
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
Buang
ayoub

i have the same problem, any help ?

Avatar
África Santeliz
Jawaban Terbai

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
Buang
Avatar
Dharmesh Prajapati
Jawaban Terbai
import { getTemplate } from "@web/core/templates" ;
const app = new App(Js, { getTemplate,});
app.mount(target);
use this......
0
Avatar
Buang
Avatar
Elodie Meunier
Jawaban Terbai

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

0
Avatar
Buang
Avatar
Guillaume Deflaux
Jawaban Terbai

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

0
Avatar
Buang
Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
What is the correct ORM count function to use within Odoo Owl component?
v15 Dashboard OWL
Avatar
Avatar
1
Feb 24
3436
How to extend class with Owl JS in V15? Diselesaikan
javascript v15 OWL
Avatar
Avatar
1
Jan 24
8941
How to load external JavaScript library asynchronously using onWillStart function in Owl?
chart v15 Dashboard OWL
Avatar
Avatar
2
Des 23
6580
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 Diselesaikan
report template v15 xslx
Avatar
Avatar
1
Feb 23
4592
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

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