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

Odoo Web Service API - Search Domain Matching ?

S'inscrire

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

Cette question a été signalée
domain_filter
2 Réponses
7875 Vues
Avatar
Joshua Hintze

Hello,


I'm trying to perform a search_read RPC with the following domain matching on employee_id. Typically the return value from employee_id is: 


employee_id: [ 274, 'Doe, John G' ]


I've tried lots of combinations such as:

[ 'employee_id', '=', '274' ]

[ 'employee_id', '=', '[274]' ]

[ 'employee_id', '=', '[274, 'Doe, John G' ]

etc.


What would be the correct domain match string?

Thanks!

0
Avatar
Ignorer
Ray Carnes

Thank you, When I was trying it earlier it wasn't working , but it might be that I was trying a "get" command instead of a "search_read". It seems to be working now.


Thanks

Avatar
Ray Carnes
Meilleure réponse

A domain is a list of criteria, each criterion being a triple (either a list or a tuple) of (field_name, operator, value)


So in your example, like this:

[   ('employee_id', '=', [1])   ]


For example, this code:

#!/usr/bin/env python
# coding: utf-8

import xmlrpclib

dbname = '246626-10-0-928fbd-all'
username = 'admin'
pwd = 'admin'

sock_common = xmlrpclib.ServerProxy('http://246626-10-0-928fbd.runbot8.odoo.com/xmlrpc/common')
sock = xmlrpclib.ServerProxy('http://246626-10-0-928fbd.runbot8.odoo.com/xmlrpc/object')

uid = sock_common.login(dbname, username, pwd)

timesheet_ids = sock.execute(dbname, uid, pwd, 'hr_timesheet_sheet.sheet', 'search_read',
[('employee_id', '=', [1])])

if timesheet_ids:
    print 'employee 1 returned: %s\n\n' % str(timesheet_ids)
else:
    print 'employee 1 not found\n\n'

timesheet_ids = sock.execute(dbname, uid, pwd, 'hr_timesheet_sheet.sheet', 'search_read',
[('employee_id', '=', [987654321])])

if timesheet_ids:
    print 'employee 987654321 returned: %s\n\n' % str(timesheet_ids)
else:
    print 'employee 987654321 not found\n\n'


Prints this:

employee 1 returned: [{'message_follower_ids': [3378], 'timesheet_ids': [35, 32, 31, 39], 
'create_date': '2017-07-18 19:10:52', 'attendance_count': 0,
'message_needaction': False, 'message_channel_ids': [],
'message_partner_ids': [3], 'attendances_ids': [],
'write_uid': [1, 'Administrator'], 'id': 3,
'create_uid': [1, 'Administrator'], 'employee_id': [1, 'Pieter Parker'],
'user_id': [1, 'Administrator'], 'message_is_follower': True,
'__last_update': '2017-07-18 19:11:10', 'date_from': '2017-07-17',
'message_last_post': False, 'company_id': False, 'period_ids': [31, 35],
'message_ids': [6421, 6420, 6419], 'state': 'draft',
'message_unread_counter': 0, 'department_id': [3, 'Management'],
'total_attendance': 0.0, 'account_ids': [35, 40, 31, 41, 37, 39],
'write_date': '2017-07-18 19:11:10', 'date_to': '2017-07-23',
'display_name': 'Week 29', 'total_difference': -22.0,
'name': False, 'total_timesheet': 22.0, 'message_unread': False,
'message_needaction_counter': 0}]


employee 987654321 not found


More at 

https://www.odoo.com/documentation/10.0/reference/orm.html#reference-orm-domains


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é
Dynamic Domain for states
domain_filter
Avatar
Avatar
1
mai 24
3421
Odoo v16 domain, how to create a domain by user.company_id
domain_filter
Avatar
Avatar
1
nov. 22
6041
Filtering domain
domain_filter
Avatar
Avatar
2
juil. 22
4538
Search domain : multiple condition Résolu
domain_filter
Avatar
Avatar
2
mai 18
10559
Filtering orders, purchases, invoices based on a product field Résolu
domain_filter
Avatar
5
juil. 15
6667
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