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
    • Discuss
    • 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

How to create a new HTML tag (or maybe how to add an OWL component that is not a widget to a view)

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
xmlcomponentsOWL
1 Balas
4445 Tampilan
Avatar
Luiz Fernando Mendonca

(using Odoo16)

I can write components and use them as widgets to my fields; but how can I write a component that is independent of any field and just add it to the view?

For example, the simple component in the Odoo tutorial documentation, I can use that if I add it to the field register and then use it as a field widget, but how could I use it on its own? (eg. maybe just an html tag like "hr" for example)

Many thanks!!

0
Avatar
Buang
Avatar
shubham shiroya
Jawaban Terbai

In Odoo 16, you can create a standalone component that is independent of any specific field and add it to the view. This can be achieved by creating a custom widget that doesn't require being attached to a field.

Here's an example of how you can create a standalone component and use it in a view:

  1. Define your custom widget:
odoo.define('your_module.YourWidget', function (require) {
"use strict";
var basic_fields = require('web.basic_fields');

var YourWidget = basic_fields.Field.extend({
template: 'your_module.your_widget_template',

// Add any necessary logic and methods specific to your component

});

return YourWidget;
});

note: here i can't add xml with complete format because when i add current format of xml and save the answer i see the blank code,so here i remove the tag like(< >) and edit the file
  1. Create the template for your widget (your_widget_template.xml):
template id="your_module.your_widget_template" inherit_id="web.basic_fields.Field">
div

/div
/template

  1. Create a view and add your standalone component:

record id="view_your_component" model="ir.ui.view"
field name="name">your.component.view field name="model">your.model field name="arch" type="xml"
div>
!-- Add your standalone component by including the widget --
/div
/field
/record





In the above example, you define a custom widget YourWidget that extends the Field widget. You then specify a template for the widget, where you can define the HTML code for your standalone component.

To use this standalone component in a view, you include the widget in the desired location within the XML view definition. In this case, it's added as a field with the widget attribute set to "your_module.YourWidget". This will render your custom component independently in the view.

Make sure to replace "your_module" with the actual module name you're working with, and adjust the code according to your specific component requirements.

By following these steps, you can create a standalone component in Odoo 16 and include it in a view without being tied to a specific field.


2
Avatar
Buang
Luiz Fernando Mendonca
Penulis

Many thanks for the detailed response, unfortunately none of the code made it to the forum, so we can't really know what you did there :(

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
How to add a new button after the Create button in tree view? Diselesaikan
xml button OWL odoo16features
Avatar
Avatar
Avatar
Avatar
Avatar
5
Jul 25
9075
How to close custom ir.actions.client view?
xml odoo OWL client-action
Avatar
0
Agu 25
722
Skills needed for Odoo OWL Development ?
OWL
Avatar
Avatar
Avatar
2
Sep 25
2836
Enable Counters in odoo what is the use of it Diselesaikan
xml
Avatar
Avatar
1
Mar 25
2885
Owl How can I import components from another module?
OWL
Avatar
Avatar
Avatar
Avatar
Avatar
5
Mar 25
4560
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