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

Auto Completion in odoo

S'inscrire

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

Cette question a été signalée
autocompleteodooodoo8.0ajax
3 Réponses
7801 Vues
Avatar
silpa m s

Hi,

I would like to select a customer from the select box by start typing its phone number.
How can I do that?
I have seen that we can use name_search method how to use it, both back end and frond end ?
Is anyone know this?

Thanks in advance.


0
Avatar
Ignorer
Avatar
Raaj Mishra
Meilleure réponse

Hi Silpa,

You can achieve it using a combination of _rec_name,name_search and name_get methods as follows:

1. You need to define _rec_name like:

_rec_name = 'mobile'

2. Need to override name_search as:

def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100):

        res = super(res_partner,self).name_search(cr,user,name,args,operator,context,limit)

        if not res:

                ids = self.search(cr, user, [('mobile',operator,name)], limit=limit, context=context)

                res = self.name_get(cr, user, ids, context=context)

        return res

3. Need to override name_get as:

def name_get(self, cr, uid, ids, context=None):

        if context is None:

                context = {}

        if isinstance(ids, (int, long)):

                ids = [ids]

        res = []

        reads = self.read(cr, uid, ids, ['name', 'mobile'], context=context)

        for record in reads:

                if record['name']:

                        name = record['name']

                res.append((record['id'], name))

        return res

0
Avatar
Ignorer
Avatar
Chandni Gandhi
Meilleure réponse

Hi  Silpa, 

You have to use particular filter_domain in search view:

Inherit the res.partner search view and then add this line:

 <field name="phone" filter_domain="['|',('phone','ilike',self)]"/>

 


Hope This WilL Help You. Give Thumps up.!


Thanks,

ChanDni.

2
Avatar
Ignorer
Avatar
silpa m s
Auteur Meilleure réponse

Hi ChanDni,

Thank you for your answer.And what i need is to select a customer in select box or many2one field in another form.

0
Avatar
Ignorer
Chandni Gandhi

I am not getting what actual your requirement is. Select Customer in select box? !! and many2one field can be there in another form. What functionality you want?

silpa m s
Auteur

i have a form with many2one field(customer selection box) and if i have 2 customers with same name like 'A' so i need to search a customer with his mobile number with in that selection box.

Chandni Gandhi

Then you should use the name_get method. Inherit the object res.partner and overwrite the method name_get:

@api.multi

def name_get(self):

result = super(res_partner,self).name_get()

for record in self:

....

your code...

....

return .....

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é
odoo v8 requisition line
odoo odoo8.0
Avatar
Avatar
1
déc. 18
3298
Odoo 8 shows operationalError : fe_sendauth: no password supplied
odoo odoo8.0
Avatar
Avatar
2
oct. 18
8130
'form_view_ref' is not working in odoo 8.
odoo odoo8.0
Avatar
Avatar
1
déc. 16
7993
Calling certain function from odoo models using odoo web service Résolu
odoo odoo8.0
Avatar
Avatar
1
août 16
4237
Odoo slowing down when working on more than 5 browser cards
odoo odoo8.0
Avatar
Avatar
1
mai 16
3933
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