Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

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

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
xmlcomponentsOWL
1 Răspunde
4447 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
Imagine profil
shubham shiroya
Cel mai bun răspuns

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
Imagine profil
Abandonează
Luiz Fernando Mendonca
Autor

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 :(

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
How to add a new button after the Create button in tree view? Rezolvat
xml button OWL odoo16features
Imagine profil
Imagine profil
Imagine profil
Imagine profil
Imagine profil
5
iul. 25
9075
How to close custom ir.actions.client view?
xml odoo OWL client-action
Imagine profil
0
aug. 25
722
Skills needed for Odoo OWL Development ?
OWL
Imagine profil
Imagine profil
Imagine profil
2
sept. 25
2836
Enable Counters in odoo what is the use of it Rezolvat
xml
Imagine profil
Imagine profil
1
mar. 25
2886
Owl How can I import components from another module?
OWL
Imagine profil
Imagine profil
Imagine profil
Imagine profil
Imagine profil
5
mar. 25
4560
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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