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

Menu items disappear after opening client action via login wizard in Odoo 18

S'inscrire

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

Cette question a été signalée
menumenuitemclient-actionmenu items
256 Vues
Avatar
Mirodil Ortikov

Hi everyone,

I'm developing a custom app in Odoo 18 that opens a client-side frontend (ir.actions.client) after user authentication. The app has its own menu root and submenus.

Here’s how it works:

  • If the user has a valid token → directly open the app
  • If not → open a login wizard
  • After successful login → call _action_open_documents_list() which returns an ir.actions.client

The issue:

When the user is already logged in, clicking the menu opens the app correctly, and all menu items remain visible.

But when opening via the login wizard (i.e., first-time login), the app opens successfully, but all Odoo menu items disappear from the top bar (only the app switcher and user menu remain).

This seems to be related to the `app...

Minimal reproducible code

XML – menus & server actions

<odoo>

    <menuitem id="didox_menu_root" name="Didox" sequence="10"

              web_icon="didox,static/description/didox-logo.png"/>

    <!-- server actions that call the backend method -->

    <record id="action_didox_incoming_server" model="ir.actions.server">

        <field name="name">Incoming</field>

        <field name="model_id" ref="base.model_res_users"/>

        <field name="state">code</field>

        <field name="code">

            action = env["didox.backend"].sudo().action_open_app(owner=0)

        </field>

    </record>

    <!-- … other server actions (Outgoing, Draft, …) … -->

    <menuitem id="didox_menu_documents" name="Documents"

              parent="didox_menu_root" sequence="1"/>

    <menuitem id="didox_menu_incoming" name="Incoming"

              parent="didox_menu_documents" action="action_didox_incoming_server" sequence="1"/>

    <!-- … other sub-menus … -->

</odoo>

Python – backend helper

from datetime import datetime, timedelta, timezone
from odoo import fields, models, _

class DidoxBackend(models.Model):
    _name = "didox.backend"
    _description = "Didox backend helpers"

    def action_open_app(self, owner: int = 0, status: int = None):
        user = self.env.user
        now = datetime.now(timezone.utc)

        if user.didox_user_token and user.didox_user_token_exp:
            exp = fields.Datetime.from_string(user.didox_user_token_exp).replace(tzinfo=timezone.utc)
            if exp > now:
                return self._action_open_documents_list(owner=owner, status=status)

        # no valid token → open login wizard
        return {
            "type": "ir.actions.act_window",
            "name": _("Login to Didox"),
            "res_model": "didox.login.wizard",
            "view_mode": "form",
            "target": "new",
        }

    def _action_open_documents_list(self, owner: int, status: int = None):
        return {
            "type": "ir.actions.client",
            "tag": "didox_client_page",
            "target": "current",
            "params": {"owner": owner, "status": status},
        }

Wizard – login action (called after successful login)


def action_login(self):
    self.ensure_one()
    # … login logic, token saved on res.users …
    self.env.user.write({
        "didox_user_token": token,
        "didox_user_token_exp": fields.Datetime.to_string(
            datetime.now(timezone.utc) + timedelta(minutes=360)
        ),
    })

    return {
        "type": "ir.actions.client",
        "tag": "didox_client_page",
        "target": "current",
        "params": {"owner": 0},
    }
0
Avatar
Ignorer
Christoph Farnleitner

Your example source is missing way to many details to have it run as an example. I.e. what's didox_client_page?

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é
Dropdown sub-menu offset away from position
menu menuitem
Avatar
0
déc. 24
1755
How to create a new menu item and place it under other module's menu? Résolu
menu menuitem
Avatar
Avatar
Avatar
Avatar
4
oct. 19
35143
After finishing installation I do not get any menu items the page is blank
menu menuitem
Avatar
Avatar
1
avr. 17
4483
No such external ID currently defined in the system error while adding a menu item.
menu menuitem
Avatar
Avatar
2
mars 15
8116
Hide Or Remove Messaging Menu From Top Menu Bar ? Résolu
menu menuitem
Avatar
Avatar
Avatar
2
janv. 24
14620
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