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č

XMLRPC: How to fetch a list of all ids that belongs to a given model?

Naroči se

Get notified when there's activity on this post

This question has been flagged
v7searchxmlrpc
2 Odgovori
18841 Prikazi
Avatar
Francisco Luz

I am aware that I have to structure my xmlrpc query like this:

ids = execute(dbname, uid, pwd, model, 'search', args)
fields = ['field_a', 'field_b', 'field_c']
elements = execute(dbname, uid, pwd, model, 'read', ids, fields)

I need help on structuring the args parameter in order to fetch a list of available elements from these models:

  • res.users as in Settings->Users
  • res.company as in Settings->Companies
  • res.partners as in Sales->Customers and Purchases->Suppliers
  • sale.order as in Sales->Sales Orders
  • account.invoice as in Accounting->Customer Invoices
  • purchase.order as in Purchases->Quotations and Purchases->Purchase Orders

UPDATE 1

Each model fetch request should return all the ids that belong to a given company id.

0
Avatar
Opusti
Avatar
Francisco Luz
Best Answer

I see a lot of articles all over the internet talking about how to use xmlrpc on OpenERP 7 and all of them seem to be based on the xmlrpc documentation from the OpenERP 6.

Although not too sure, I think the xmlrpc docs from v6 is mostly outdated for v7.

For starters, there are new methods and endpoints on v7. They are:

  • Method read | /web/dataset/search_read
  • Method authenticate | /web/session/authenticate
  • Method get_session_info | /web/session/get_session_info
  • Method destroy | /web/session/destroy

For those like me interested in implementing a php app, I found this very handy library called php-oe-json hosted at github.

Here are some examples on how to retrieve data from OpenERP 7 using php-oe-json

$oe = new PhpOeJson\OpenERP('http://localhost:8069', 'database_name'); 
$oe->login('admin', 'pwd');

// Get a list of records from a model.
$products = $oe->read(array(
   'model' => 'product.product',
   'fields' => array('name', 'id'),
   'limit' => 20,
   // XXXvlab: bug of openerp 7.0+ which will default domain to "None" if not set, and
   // override of ``_search`` doesn't support ``None`` value.
   'domain' => array(),
));
echo '<pre>';
print_r($products);

// Get a single record from a model.
$so = $oe->read(array(
   'model' => 'sale.order',
   'fields' => array('name', 'id'),
   'limit' => FALSE,
   'domain' => array(array('company_id', '=', 1), array('name', '=', 'SO002')),
));

print_r($so);
1
Avatar
Opusti
Martin

So where is the V7 documentation?

Francisco Luz

There isn't any apparently. My guess is that the php-oe-json author just sniffed into the openerp web module for figuring out how the xmlrpc calls were processed.

Avatar
Martin
Best Answer

I would strongly recommend that you do not try to work with XMLRPC directly.

Have a look at this: Should I use [oerplib] OR [openerp-client-lib] ?

The documentation of oerplib may have an example of what you are trying to do.

Update : When I first started working with XMLRPC APIs, I always found it necessary to start a little library of convenience routines. I'd end up fiddling with it, adding little bits, thinking up cool things to do, etc. etc. Next, thing I knew I'd got yet more code to maintain and all the crap that goes with it. The best way to deal with THAT is to open source it and hope to get collaborators who also need that functionality. It's at the point that I discover a pre-existing library that's much better done than my own and that I should have been using from outset.

1
Avatar
Opusti
Ray Carnes

Can you post why? Philosophical, Technical, etc?

Francisco Luz
Avtor

My hope is to be able to communicate with OpenERP without having to use python. I will take a look at the links you provided. Thank you.

Francisco Luz
Avtor

I played with oerplib and apparently it has what I need. Although it would be better if did not have to write my own intermediary python service.

Martin

What language are you using then?

Francisco Luz
Avtor

PHP.......

Martin

Ok. Now it is clear why my answer is less than relevant. Thanks for flagging it as the right answer despite that. If you published a PHP version of oerplib.py on GitHub I expect you'd get some eager collaborators eventually, even if what you put there served exactly your needs and no more..

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
How to search for several words in products name from sales order? Solved
v7 search
Avatar
Avatar
Avatar
Avatar
8
jul. 24
17249
Why does my XMLRPC path return a 404 error? Solved
v7 xmlrpc
Avatar
1
dec. 24
15805
How can I locate the certain SO/PO with the product code/desc?
v7 search
Avatar
Avatar
Avatar
2
mar. 15
6557
list res.partner with XMLRPC
v7 xmlrpc
Avatar
Avatar
Avatar
2
mar. 15
13784
Is /xmlrpc not included in OpenERP v7 apt repo?
v7 xmlrpc
Avatar
Avatar
1
mar. 15
6118
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