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

How can I add buttons to the header of a List View (for quick access to things in the Action Menu)

S'inscrire

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

Cette question a été signalée
headerlistbuttonsquickstartv14
3 Réponses
16056 Vues
Avatar
Ray Carnes (ray)

When you install Apps by selecting multiple, an INSTALL button shows at the top of the List View:



This provides quick access to the INSTALL option, which is also found in the ACTION Menu.


In CRM, I would like to make several of the options available in the ACTION Menu into buttons at the top of that List View.

How can I do this?  

0
Avatar
Ignorer
Avatar
Niyas Raphy (Walnut Software Solutions)
Meilleure réponse

Hi,

You can add buttons inside the tree view as follows,

<record id="module_tree" model="ir.ui.view">
<field name="name">ir.module.module.tree</field>
<field name="model">ir.module.module</field>
<field name="arch" type="xml">
<tree decoration-info="state=='to upgrade' or state=='to install'" decoration-danger="state=='uninstalled'" decoration-muted="state=='uninstallable'" create="false" string="Apps">
<header>
<button name="button_immediate_install" type="object" string="Install"/>
</header>

<field name="shortdesc"/>
<field name="name" groups="base.group_no_one"/>
<field name="author"/>
<field name="website"/>
<field name="installed_version"/>
<field name="state"/>
<field name="category_id" invisible="1"/>
</tree>
</field>
</record>

Inside the tree tag, you can define the buttons inside the header tag as we define in the form view. This option has been introduced in the odoo 14.


The above attached code sample is the tree view of the apps menu which you shown in the question. Lot of such sample can be seen inside odoo 14 source code.


General Syntax:

<record id="tree_name" model="ir.ui.view">
<field name="name">model_name.tree</field>
<field name="model">model_name</field>
<field name="arch" type="xml">
<tree>
<header>
<button name="button_name" type="object" string="Label"/>
</header>

<field name="field_1"/>
<field name="field_2"/>
</tree>
</field>
</record>

Thanks

3
Avatar
Ignorer
Avatar
Adil Akbar
Meilleure réponse

Hi, you can follow this: https://youtu.be/mcDKP-4-4-E

Hope it helps,

thanks

1
Avatar
Ignorer
Avatar
Ray Carnes (ray)
Auteur Meilleure réponse

One way is to write Server Actions that execute the Python Method in the class (model).

The "delete" action is a generic method to all models and you can make a Server Action like this:


This will have an ID that you will see in the URL when you are looking at it, or via the View Metadata option from the Debug Menu when in Developer Mode:


This ID field is used to create the button for the top of the List View:



When these two things are done, the List now looks like this:



You can review the code to find the methods for the other Actions you want to add, or search the Actions Menu to find some of the common ones:



This was ID 111 so you can also add it like this:

<tree position="inside">
  <header>
    <button name="84" string="Delete" type="action"/>
    <button name="111" string="Email" type="action"/>
  </header>  
</tree>


The List will then look like this:



0
Avatar
Ignorer
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é
comment envoyer des email from button submit in odoo 14
buttons sender v14
Avatar
0
avr. 25
2040
How to remove default odoo website navbar in odoo14.
header website v14
Avatar
Avatar
1
mai 23
4359
How to male approval button without Studio
buttons approval v14
Avatar
Avatar
Avatar
2
juin 24
4585
How to resolve this : TypeError: list indices must be integers or slices, not str - - -
list typeError v14
Avatar
0
mai 22
3267
How to solve the badRequest error when trying to submit Youtube videos to the elearning application ? Résolu
quickstart elearning v14
Avatar
Avatar
2
mars 22
4986
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