Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

How do I put XMLRPC parameters to list record

Odoberať

Get notified when there's activity on this post

This question has been flagged
xmlrpcjava
2 Replies
15031 Zobrazenia
Avatar
IGAM Muliarsa

anyone can help me to put XMLRPC parameters to list record?

I wrote this method and change the parameters from :

asList((Object[])models.execute("execute_kw", asList(
db, uid, password,
"res.partner", "search",
asList(asList(
asList("is_company", "=", true),
asList("customer", "=", true)))
)));

 to 

Object[] paramsMethod = new Object[]{
new Object[] {"is_company", "=", true},
new Object[] {"customer", "=", true}
};
Object[] params = new Object[] {db, uid, password, resource, action, paramsMethod};
Object result = client.execute("execute_kw", params);
System.out.println("done");

and error arise:

Exception in thread "main" org.apache.xmlrpc.XmlRpcException: Traceback (most recent call last):

File "/usr/lib/python2.7/dist-packages/openerp/service/wsgi_server.py", line 75, in xmlrpc_return

result = openerp.http.dispatch_rpc(service, method, params)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 114, in dispatch_rpc

result = dispatch(method, params)

File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 37, in dispatch

res = fn(db, uid, *params)

File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 162, in execute_kw

return execute(db, uid, obj, method, *args, **kw or {})

File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 113, in wrapper

return f(dbname, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 170, in execute

res = execute_cr(cr, uid, obj, method, *args, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 159, in execute_cr

return getattr(object, method)(cr, uid, *args, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 1639, in search

return self._search(cr, user, args, offset=offset, limit=limit, order=order, context=context, count=count)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/addons/base/res/res_partner.py", line 656, in _search

count=count, access_rights_uid=access_rights_uid)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 4621, in _search

query = self._where_calc(cr, user, args, context=context)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 4438, in _where_calc

if not any(item[0] == 'active' for item in domain):

File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 4438, in <genexpr>

if not any(item[0] == 'active' for item in domain):

TypeError: 'bool' object has no attribute '__getitem__'

at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:197)

at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:156)

at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:143)

at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69)

at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)

at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)

at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:137)

at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:126)

at TutorialLocal.listRecord(TutorialLocal.java:193)

at TutorialLocal.main(TutorialLocal.java:81)

This is the method:

static Object listRecord(int uid, String url, String db, String username, String password, String resource, String action) throws MalformedURLException, XmlRpcException {
      XmlRpcClient client = new XmlRpcClient();
      XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
      config.setEnabledForExtensions(true);
      //config.setServerURL(new URL(url+"/xmlrpc/object")); // OK
      config.setServerURL(new URL(url+"/xmlrpc/2/object")); // OK
      client.setConfig(config);
      Object[] paramsMethod = new Object[]{
          new Object[] {"is_company", "=", true},
           new Object[] {"customer", "=", true}
      };
      System.out.println(resource);
      System.out.println(action);
      System.out.println(paramsMethod.toString());
      Object[] params = new Object[] {db, uid, password, resource, action, paramsMethod};
      Object result = client.execute("execute_kw", params);
      System.out.println("done");
      return result;
}

0
Avatar
Zrušiť
Avatar
IGAM Muliarsa
Autor Best Answer

hi.....

don worry about the question, I found the solution. please try and give correct answer. :D

public static void main(String[] args) {
    // "res.partner", "search",
    System.out.println();
    System.out.println("Search res.partner");
    System.out.println("--------------");  
    Object rLR = listRecord(uid, url, db, username, password, "res.partner", "search");
    Object[] tRLR = (Object[])rLR;
    for (int i=0;i<tRLR.length;i++) {
        System.out.println(tRLR[i]);
    }
}
static Object listRecord(int uid, String url, String db, String username, String password, String resource, String action) throws MalformedURLException, XmlRpcException {
    XmlRpcClient client = new XmlRpcClient();
    XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
    config.setEnabledForExtensions(true);
    //config.setServerURL(new URL(url+"/xmlrpc/object")); // OK
    config.setServerURL(new URL(url+"/xmlrpc/2/object")); // OK
    client.setConfig(config);
    Object[] paramsMethod = new Object[]{
    new Object[] {
        new Object[] {"is_company", "=", true},
        new Object[] {"customer", "=", true}
        }
    };
    HashMap<Object,Object> paramsRules = new HashMap<Object, Object>() ;
    //paramsRules.put("offset",10);
    //paramsRules.put("limit",5);
    Object[] params = new Object[] {db, uid, password, resource, action, paramsMethod, paramsRules};
    Object result = client.execute("execute_kw", params);
    return result;
}


0
Avatar
Zrušiť
Avatar
Mind And Go
Best Answer

Maybe you could try to use the openerp-java lib that is pretty mature : https://github.com/DeBortoliWines/openerp-java-api

It is used in Pentaho Project and works for most of the releases

0
Avatar
Zrušiť
Enjoying the discussion? Don't just read, join in!

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

Registrácia
Related Posts Replies Zobrazenia Aktivita
How to access ODOO 8 using Java xmlrpc? Solved
xmlrpc java
Avatar
2
apr 15
16778
Email Invoices and Quotations using Java and XMLRPC
xmlrpc java odoo
Avatar
Avatar
1
júl 25
2311
Retrieve many2one field value using xmlrpc java
many2one xmlrpc java
Avatar
Avatar
2
mar 15
11737
xmlrpc Error when attempting to connect to my local instance Solved
xmlrpc
Avatar
Avatar
Avatar
3
júl 25
4213
Cannot marshal None unless allow_none is enabled
xmlrpc
Avatar
1
okt 24
3077
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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