Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Nekilnojamasis turtas
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Konsultavimas
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Maistas
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Saulės energijos sistemos
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Kiti
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

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

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
xmlcomponentsOWL
1 Atsakyti
4449 Rodiniai
Portretas
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
Portretas
Atmesti
Portretas
shubham shiroya
Best Answer

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
Portretas
Atmesti
Luiz Fernando Mendonca
Autorius

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!

Registracija
Related Posts Replies Rodiniai Veikla
How to add a new button after the Create button in tree view? Solved
xml button OWL odoo16features
Portretas
Portretas
Portretas
Portretas
Portretas
5
liep. 25
9075
How to close custom ir.actions.client view?
xml odoo OWL client-action
Portretas
0
rugp. 25
722
Skills needed for Odoo OWL Development ?
OWL
Portretas
Portretas
Portretas
2
rugs. 25
2836
Enable Counters in odoo what is the use of it Solved
xml
Portretas
Portretas
1
kov. 25
2886
Owl How can I import components from another module?
OWL
Portretas
Portretas
Portretas
Portretas
Portretas
5
kov. 25
4560
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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