Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • eLearning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Información
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y asistencia informática
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Browse all Industries
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Services for Partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyecto
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

standalone OWL application and used Odoo’s Dialog Service?

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
javascriptservicedialogowlOwlError
3 Respuestas
2501 Vistas
Avatar
bayuik

Has anyone ever built a standalone OWL application and used Odoo’s Dialog Service?

I'm following the official documentation here:

https://www.odoo.com/documentation/18.0/developer/howtos/standalone_owl_application.html

I've tried to keep the UI as minimal as possible and followed the code from the documentation. My root component looks more or less like the example. When I console.log(this.dialogService), the function is there. I also checked the Elements tab and confirmed that the modal-open class is injected into the <body>.

However, the modal dialog does not appear on the screen.

Has anyone encountered a similar issue or found a solution?

0
Avatar
Descartar
Avatar
bayuik
Autor Mejor respuesta

I’m currently on Odoo 18 Community. After checking the source code (versions 15 to 18) on GitHub, I couldn’t find a component named DialogContainer.

I’ve also attempted to use DialogWrapper and Dialog, but unfortunately the dialog still doesn’t appear on screen.

Have you tested the code snippet you shared? If so, would you be willing to share a minimal working module? That would be extremely helpful.

0
Avatar
Descartar
Avatar
Rufus Khalkho
Mejor respuesta

.

0
Avatar
Descartar
Avatar
D Enterprise
Mejor respuesta

Hii,

The dialog service depends on the DialogContainer component being mounted somewhere in your root DOM. Otherwise, no dialogs will render even though the service is functional and modal-open gets injected.

Make sure your root OWL app includes the DialogContainer , like this:

import { mount, Component, useService } from "@odoo/owl";

import { DialogContainer } from "@web/core/dialog/dialog_container";


class Root extends Component {

  static template = "test_mobile.Root";


  setup() {

    this.dialogService = useService("dialog");

  }


  ShowDialog() {

    console.log("ShowDialog clicked", this.dialogService);

    this.dialogService.add(AlertDialog, {

      body: "This is a working OWL Alert Dialog!",

    });

  }

}


Root.components = { DialogContainer };


mount(Root, {

  target: document.body,

  services: {

    dialog: dialogService,

  },

});

Make sure you're importing dialogService from @web/core/dialog/dialog_service

Make Sure You Actually Render DialogContainer in Your Template
<DialogContainer/>


i hope it is usefull


0
Avatar
Descartar
bayuik
Autor

Thanks for the detailed explanation!

I’ve tried that, but it still doesn’t work. I checked the import:
import { DialogContainer } from "@web/core/dialog/dialog_container";

It seems that DialogContainer no longer exists — or at least I couldn’t find it.
Maybe you meant:
import { Dialog } from "@web/core/dialog/dialog";

If so, I’ve also tried that, but unfortunately the dialog still doesn’t show up.

I've pushed the sample code to GitHub in case you'd like to take a look or help troubleshoot:
🔗 https://github.com/bayuik/test_mobile

Really appreciate any help!

D Enterprise

Hii,
In your JS (likely root.js):
Make sure you include this:
import { mount, Component, useService } from "@odoo/owl";
import { dialogService } from "@web/core/dialog/dialog_service";
import { DialogContainer } from "@web/core/dialog/dialog_container"; // ✅ required
import { AlertDialog } from "@web/core/confirmation_dialog/confirmation_dialog";

export class Root extends Component {
static template = "test_mobile.Root";

setup() {
this.dialogService = useService("dialog");
}

ShowDialog() {
console.log("ShowDialog clicked", this.dialogService);
this.dialogService.add(AlertDialog, {
body: "This is a working OWL Alert Dialog!",
});
}
}

Root.components = { DialogContainer };

mount(Root, {
target: document.body,
services: {
dialog: dialogService,
},
});
In your QWeb XML (likely root.xml):
Ensure that your root template renders the DialogContainer like this:
<t t-name="test_mobile.Root">
<div>
<h1>Hello World!</h1>
<button t-on-click="ShowDialog">Show Dialog</button>

<!-- required so dialogs can be shown -->
<DialogContainer/>
</div>
</t>
If <DialogContainer/> is not included, the dialogService still works in memory, but no modal will appear.
In __manifest__.py
Make sure these files are included in your assets:
'assets': {
'web.assets_frontend': [
'test_mobile/static/src/static/*.js',
'test_mobile/static/src/static/*.xml',
],
},
Rebuild or Upgrade Your Module
try this i hope it is usefull

bayuik
Autor

I’m currently on Odoo 18 Community. After checking the source code (versions 15 to 18) on GitHub, I couldn’t find a component named DialogContainer.

I’ve also attempted to use DialogWrapper and Dialog, but unfortunately the dialog still doesn’t appear on screen.

Have you tested the code snippet you shared? If so, would you be willing to share a minimal working module? That would be extremely helpful.

¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
issue in useService("bus_Service") in owl
javascript owl odoo17 OwlError
Avatar
Avatar
2
abr 25
3237
Problem with Odoo11
javascript service
Avatar
0
abr 25
1023
Patching a non-exported class
javascript point_of_sale owl
Avatar
Avatar
1
ago 25
1384
How to inherit "pay now" button click event in odoo v17
javascript qweb owl
Avatar
0
ene 25
1772
OWL Assets (18)
javascript assets owl
Avatar
Avatar
1
nov 24
3450
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y totalmente integrado.

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