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 API Issue executing search request with parameters using C# Kveer.XmlRPC

S'inscrire

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

Cette question a été signalée
c#apixmlrpcodoo
1 Répondre
7028 Vues
Avatar
upswot.azarchenkov@ukr.net

Issue executing search request with parameters using C# Kveer.XmlRPC. I can't understand what version of API I'm using, and I think that this can be a reason of issue. The proplem is reproducible only when I add 3 values("is_company", "=", true) in nested object of _params variable. In addition to this method, I have tried many for example set them as one value etc but I still receive errors. This is most common way people set parameters in this request(I get this from most different sources). So how to correctly set parameters? What I do wrong? Is it possible the api version can be reason of error?


Query code

private Response Demo() {
Response response = new Response();
try {
models.Url = "https://myexampledomain.odoo.com/xmlrpc/2/object";
string dbName = "myexampledomain";
string Uid = "2";
string pwd = "myexamplepassword";
string model = "res.partner";
XmlRpcStruct addPairFields = new XmlRpcStruct();
addPairFields.Add("raise_exception", "false");
object canAccess = models.CheckAccess(dbName, int.Parse(Uid), pwd, model, "check_access_rights",
new object[] { "read" }, addPairFields);
if (canAccess.ToString() == "True") {
object[] _params = new object[] {
new object[] { "is_company", "=", true }
};
var resultIds = models.Search(dbName, int.Parse(Uid), pwd, model, "search", _params);//error happen here
if (resultIds.Length == 0) {
response.Content = "No data";
return response;
}
_params = new[] {
resultIds
};
var result = models.GetData(dbName, int.Parse(Uid), pwd, model, "read", _params);
response.Content = JsonConvert.SerializeObject(result);
response.StatusCode = HttpStatusCode.OK;
return response;
}
response.Content = "Not access";
} catch (Exception ex) { SaveLog(ex, response); }
return response;
}


Full error text

{"Server returned a fault exception: [1] Traceback (most recent call last):\n  File \"/home/odoo/src/odoo/14.0/odoo/addons/base/controllers/rpc.py\", line 69, in xmlrpc_2\n    response = self._xmlrpc(service)\n  File \"/home/odoo/src/odoo/14.0/odoo/addons/base/controllers/rpc.py\", line 49, in _xmlrpc\n    result = dispatch_rpc(service, method, params)\n  File \"/home/odoo/src/odoo/14.0/odoo/http.py\", line 140, in dispatch_rpc\n    result = dispatch(method, params)\n  File \"/home/odoo/src/odoo/14.0/odoo/service/model.py\", line 41, in dispatch\n    res = fn(db, uid, *params)\n  File \"/home/odoo/src/odoo/14.0/odoo/service/model.py\", line 168, in execute_kw\n    return execute(db, uid, obj, method, *args, **kw or {})\n  File \"/home/odoo/src/odoo/14.0/odoo/service/model.py\", line 94, in wrapper\n    return f(dbname, *args, **kwargs)\n  File \"/home/odoo/src/odoo/14.0/odoo/service/model.py\", line 175, in execute\n    res = execute_cr(cr, uid, obj, method, *args, **kw)\n  File \"/home/odoo/src/odoo/14.0/odoo/service/model.py\", line 159, in execute_cr\n    result = odoo.api.call_kw(recs, method, args, kw)\n  File \"/home/odoo/src/odoo/14.0/odoo/api.py\", line 392, in call_kw\n    result = _call_kw_model(method, model, args, kwargs)\n  File \"/home/odoo/src/odoo/14.0/odoo/api.py\", line 365, in _call_kw_model\n    result = method(recs, *args, **kwargs)\n  File \"/home/odoo/src/odoo/14.0/odoo/models.py\", line 1704, in search\n    res = self._search(args, offset=offset, limit=limit, order=order, count=count)\n  File \"/home/odoo/src/odoo/14.0/odoo/addons/base/models/res_partner.py\", line 742, in _search\n    return super(Partner, self)._search(args, offset=offset, limit=limit, order=order,\n  File \"/home/odoo/src/odoo/14.0/odoo/models.py\", line 4485, in _search\n    if expression.is_false(self, args):\n  File \"/home/odoo/src/odoo/14.0/odoo/osv/expression.py\", line 228, in is_false\n    elif token[1] == 'in' and not (isinstance(token[2], Query) or token[2]):\nTypeError: 'bool' object is not subscriptable\n"}
0
Avatar
Ignorer
Avatar
upswot.azarchenkov@ukr.net
Auteur Meilleure réponse
                    object[] _params = new object[] {
                        new object[] {
                            new object[] {
                            "is_company", "=", true
                            }
                        }
                    };
                    var resultIds = models.Search(dbName, int.Parse(Uid), pwd, model, "search", _params);
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é
Odoo API & xmlrpc - Schema of Odoo Studio module ?
api xmlrpc odoo
Avatar
0
mai 22
3176
Odoo XML-RPC api using in C# .net
api xmlrpc odoo odoo10.0
Avatar
Avatar
Avatar
Avatar
3
sept. 22
32118
Odoo Session Expired Error When Accessing API Endpoint
api odoo
Avatar
Avatar
2
déc. 24
3430
XML-RPC API search_read method 100 records' limitation
api xmlrpc
Avatar
Avatar
Avatar
3
janv. 23
9645
ProtocolError for localhost:8069/xmlrpc/2/common: 409 Résolu
python api xmlrpc odoo v15
Avatar
Avatar
2
déc. 22
5049
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