Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

standalone OWL application and used Odoo’s Dialog Service?

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
javascriptservicedialogowlOwlError
3 Réponses
2525 Vues
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
Ignorer
Avatar
bayuik
Auteur Meilleure réponse

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
Ignorer
Avatar
Rufus Khalkho
Meilleure réponse

.

0
Avatar
Ignorer
Avatar
D Enterprise
Meilleure réponse

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
Ignorer
bayuik
Auteur

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
Auteur

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.

Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
issue in useService("bus_Service") in owl
javascript owl odoo17 OwlError
Avatar
Avatar
2
avr. 25
3268
Problem with Odoo11
javascript service
Avatar
0
avr. 25
1061
Patching a non-exported class
javascript point_of_sale owl
Avatar
Avatar
1
août 25
1403
How to inherit "pay now" button click event in odoo v17
javascript qweb owl
Avatar
0
janv. 25
1792
OWL Assets (18)
javascript assets owl
Avatar
Avatar
1
nov. 24
3510
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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