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

Text in custom filter condition select dropdown control V12

S'inscrire

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

Cette question a été signalée
viewssearch12
2 Réponses
4775 Vues
Avatar
notteccon

Hi. I want to start by apologizing for the title, I know it is very confusing, but it is the one that I came up with.

The option text in the dropdown for the custom filter condition from searchview is the same from the "string" attribute in the xml view field definition, NOT from the "string" attribute in the model field definition.

Is there a way to modify the option text?


https://ibb.co/x5NKjKv


I have a model with many fields, including 3 fields to indicate estimates (pessimistic, probable and optimistic) for different values (Date, Rating, Text, ... and many more)


rating_pess = fields.Integer(string='Rating pessimistic')
rating_prob = fields.Integer(string='Rating probable')
rating_opti = fields.Integer(string='Rating optimistic')
text_pess = fields.Char(string='Text pessimistic')
text_prob = fields.Char(string='Text probable')
text_opti = fields.Char(string='Text optimistic')
date_pess = fields.Datetime(string='Date pessimistic')
date_prob = fields.Datetime(string='Date probable')
date_opti = fields.Datetime(string='Date optimistic')
..._pess = fields.---(string='... pessimistic')
..._prob = fields.---(string='... probable')
..._opti = fields.---(string='... optimistic')


In the view, due to the UI requirement, the 3 values for each meassure unit are in different rows using a separator and the label must be "Value" for all the field.


<group col="1">
    <separator string="Text"/>
    <group col="6">
      <field name="text_pess" string="Value"/>
      <field name="text_prob" string="Value"/>
      <field name="text_opti" string="Value"/>
    </group>
    <separator string="Rating"/>
    <group col="6">
      <field name="rating_pess" string="Value"/>
      <field name="rating_prob" string="Value"/>
      <field name="rating_opti" string="Value"/>
    </group>
    <separator string="Date"/>
    <group col="6">
      <field name="date_pess" string="Value"/>
      <field name="date_prob" string="Value"/>
      <field name="date_opti" string="Value"/>
    </group>
    ...
    ...
        
    ...
    ...
</group>


This affects the dropdown control text of the fields in the custom filter, since the source of text of the options seems to be the attribute "string" in the xml view, not the "string" attribute in the field definition in the .py, so then, the text in each option is the same:  "Value", without being able to distinguish the corresponding field (the option "value" attribute in the dropdown is right, 2date_pess", "date_prob", "date_opti").


Thanks!

1
Avatar
Ignorer
Ray Carnes (ray)

This question is not clear to me. You write "the label must be "Value" for all the field" but then you also write "the text in each option is the same: "Value", without being able to distinguish the corresponding field". My conclusion is that you are making the labels the same and then asking why they are the same?

Avatar
Paresh Wagh
Meilleure réponse

If you are familiar with view customization, you can customize the view and change the values of the string. For example, to change the string value of text_pess you can use the following xpath expression.

<xpath expr="//field[@name='text_pess']" position="attributes">
    <attribute name="string">Pessimistic</attribute>
</xpath>



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é
Search in subtree
views search
Avatar
Avatar
Avatar
3
mars 15
4952
smart button v10
views search buttons
Avatar
Avatar
Avatar
2
nov. 18
8626
How to change a search vue automatically according to the current vue ?
filter views search odoo
Avatar
0
avr. 23
2751
[V12] Filter customers property_product_pricelist in res.partner Résolu
filter views search res.partner
Avatar
Avatar
2
sept. 21
5509
Domain filter attribute in a field doesn't work
views fields domain_filter 12
Avatar
Avatar
Avatar
3
mars 21
6628
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