Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

Making a request for data with C#.NET

Naroči se

Get notified when there's activity on this post

This question has been flagged
c#searchxmlrpcwebservicesrequest
1 Odgovori
16704 Prikazi
Avatar
Hans-Henrik G. Møller

Hi,

I am working on creating a small tool to work with the XML-RPC service for a hosted Odoo instance. I have managed to create the connection and authenticate, but having difficulties creating a request properly. Seems that I can not pick the correct datatype.

The php code looks like this:

$models->execute_kw($db, $uid, $password,

    'res.partner', 'search_read',
    array(array(array('is_company', '=', true),
                array('customer', '=', true))),
    array('fields'=>array('name', 'country_id', 'comment'), 'limit'=>5));

My C# code to create the parameter array looks like this:

            //search criterias
            object[] c1 = new object[] { "name", "=", "Lunderskov Boldklub" };

            //list of all criterias
            object[] criterias = new object[] { c1 };

            //fields defs

            object[] defs = { new object[] { "fields", new object[] { "name", "country_id", "comment" } }, new object[] {"limit", 5}}; 

            //parameters
            object[] parms = new object[] { criterias, defs };

Now.. the Odoo response is:

<?xml version='1.0'?>
<methodResponse>
<fault>
<value><struct>
<member>
<name>faultCode</name>
<value><string>unhashable type: 'list'</string></value>
</member>
<member>
<name>faultString</name>
<value><string>Traceback (most recent call last):
  File "/home/odoo/src/odoo/8.0/openerp/service/wsgi_server.py", line 75, in xmlrpc_return
    result = openerp.http.dispatch_rpc(service, method, params)
  File "/home/odoo/src/odoo/8.0/openerp/http.py", line 108, in dispatch_rpc
    result = dispatch(method, params)
  File "/home/odoo/src/odoo/8.0/openerp/service/model.py", line 37, in dispatch
    res = fn(db, uid, *params)
  File "/home/odoo/src/odoo/8.0/openerp/service/model.py", line 162, in execute_kw
    return execute(db, uid, obj, method, *args, **kw or {})
  File "/home/odoo/src/odoo/8.0/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/odoo/src/odoo/8.0/openerp/service/model.py", line 170, in execute
    res = execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/odoo/src/odoo/8.0/openerp/service/model.py", line 159, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/odoo/src/odoo/8.0/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/odoo/src/odoo/8.0/openerp/models.py", line 5061, in search_read
    result = self.read(cr, uid, record_ids, fields, context=read_ctx)
  File "/home/odoo/src/odoo/8.0/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/odoo/src/odoo/8.0/openerp/models.py", line 3078, in read
    result = BaseModel.read(records, fields, load=load)
  File "/home/odoo/src/odoo/8.0/openerp/api.py", line 235, in wrapper
    return new_api(self, *args, **kwargs)
  File "/home/odoo/src/odoo/8.0/openerp/models.py", line 3102, in read
    if name in self._columns:
TypeError: unhashable type: 'list'
</string></value>
</member>
</struct></value>
</fault>
</methodResponse>

So.. how should I create the last part of the request?

0
Avatar
Opusti
Avatar
Hans-Henrik G. Møller
Avtor Best Answer

I solved the problem myself finally. This code works..

 

            XmlRpcStruct d = new XmlRpcStruct();
            d.Add("fields", new object[] { "name", "country_id", "comment"});
            d.Add("limit", 5);

 

2
Avatar
Opusti
Stephen Mack

Thanks for posting the solution to your own question so that the next person might benefit from your solution.

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Prijavi
Related Posts Odgovori Prikazi Aktivnost
Search Active and Inactive Records through XML-RPC , In One Expression odoo 11
search xmlrpc webservices
Avatar
Avatar
1
nov. 19
7402
Search multiple IDS in XMLRPC
search xmlrpc
Avatar
1
mar. 15
5518
Fetch invoice pdf from odoo sh
c# xmlrpc odoo.sh
Avatar
0
sep. 23
2244
.Net 6 integrate with odoo
c# xmlrpc .Net
Avatar
Avatar
1
okt. 22
5039
How to add elements to many2many relations through the external API?
c# xmlrpc odoo11
Avatar
Avatar
1
mar. 22
5745
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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