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č

How take "product.pricelist" on through "search_read" in Java with External API?

Naroči se

Get notified when there's activity on this post

This question has been flagged
productapijava
7738 Prikazi
Avatar
Augusto Sanson Cadini

I did read the models through XMLRPC Java lib, and I can read all models, for example:


try {
            models_config.setServerURL(new URL(host + "/xmlrpc/2/object"));
            models.setConfig(models_config);

            Object[] lista = (Object[]) models.execute("execute_kw",
                                                              asList(
                                                                      db,
                                                                      uid,
                                                                      password,
                                                                      "product.template",
                                                                      "search_read",
                                                                      asList(asList())
                                                                      ,new HashMap() {{  put("limit",1); }}                                                     )                                                                
            );
            for( Object obj : lista ) {
                System.out.println(String.valueOf(obj));
            }      
         } catch (Exception e) {
             e.printStackTrace();
         }


This return correctely to me:

{write_date=2018-03-23 14:49:50, company_ax_id=[Ljava.lang.Object;@4b952a2d, description_purchase=false, message_partner_ids=[Ljava.lang.Object;@3159c4b8, lst_price=1.0, qty_amount=0.0, message_channel_ids=[Ljava.lang.Object;@73846619, attribute_line_ids=[Ljava.lang.Object;@4bec1f0c, type=consu, fiscal_class_code=38089999, description_sale=false, destination_type=sale, seller_ids=[Ljava.lang.Object;@29ca901e, product_variant_count=1, price=0.0, last_update=false, warranty=0.0, id=99, create_date=2018-03-23 14:47:38, default_code=2262, barcode=false, invoice_policy=order, image=, product_variant_ids=[Ljava.lang.Object;@5649fd9b, standard_price=0.0, __last_update=2018-03-23 14:49:50, pricelist_id=false, expense_policy=no, weight=0.0, active=true, message_follower_ids=[Ljava.lang.Object;@6adede5, create_uid=[Ljava.lang.Object;@2d928643, display_name=[2262] Armadilha de Bob c/ Pupa, volume=0.0, sequence=1, uom_id=[Ljava.lang.Object;@5025a98f, image_small=, packaging_ids=[Ljava.lang.Object;@49993335, track_service=manual, item_ids=[Ljava.lang.Object;@20322d26, name=Armadilha de Bob c/ Pupa, categ_id=[Ljava.lang.Object;@192b07fd, write_uid=[Ljava.lang.Object;@64bfbc86, message_is_follower=false, color=0, uom_po_id=[Ljava.lang.Object;@64bf3bbf, sale_ok=true, image_medium=, description=false, taxes_id=[Ljava.lang.Object;@55d56113, message_unread=false, supplier_taxes_id=[Ljava.lang.Object;@148080bb, qty_reserved=0.0, message_last_post=false, property_account_income_id=false, sale_line_warn=no-message, purchase_ok=true, company_id=[Ljava.lang.Object;@dc24521, multiple=1, sales_count=0, list_price=1.0, qty_available=0.0, rental=false, message_unread_counter=0, product_group_id=false, property_account_expense_id=false, message_needaction=false, related_ids=[Ljava.lang.Object;@10bdf5e5, message_needaction_counter=0, message_ids=[Ljava.lang.Object;@6e1ec318, sale_line_warn_msg=false, restricted_view=false, product_variant_id=[Ljava.lang.Object;@7e0b0338, currency_id=[Ljava.lang.Object;@617faa95}


And, this happens with other models. But when I tries get product.pricelist model, in the same code, only change product.template to product.pricelist, I get the error


org.apache.xmlrpc.XmlRpcException: Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/odoo/service/wsgi_server.py", line 56, in xmlrpc_return
    result = odoo.http.dispatch_rpc(service, method, params)
  File "/usr/lib/python2.7/site-packages/odoo/http.py", line 118, in dispatch_rpc
    result = dispatch(method, params)
  File "/usr/lib/python2.7/site-packages/odoo/service/model.py", line 38, in dispatch
    res = fn(db, uid, *params)
  File "/usr/lib/python2.7/site-packages/odoo/service/model.py", line 175, in execute_kw
    return execute(db, uid, obj, method, *args, **kw or {})
  File "/usr/lib/python2.7/site-packages/odoo/service/model.py", line 119, in wrapper
    return f(dbname, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/odoo/service/model.py", line 182, in execute
    res = execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/lib/python2.7/site-packages/odoo/service/model.py", line 171, in execute_cr
    return odoo.api.call_kw(recs, method, args, kw)
  File "/usr/lib/python2.7/site-packages/odoo/api.py", line 679, in call_kw
    return call_kw_model(method, model, args, kwargs)
  File "/usr/lib/python2.7/site-packages/odoo/api.py", line 664, in call_kw_model
    result = method(recs, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/odoo/addons/sale_nfe/models/product_pricelist.py", line 33, in search_read
    headers = request.httprequest.headers
  File "/usr/lib/python2.7/site-packages/werkzeug/local.py", line 343, in __getattr__
    return getattr(self._get_current_object(), name)
  File "/usr/lib/python2.7/site-packages/werkzeug/local.py", line 302, in _get_current_object
    return self.__local()
  File "/usr/lib/python2.7/site-packages/werkzeug/local.py", line 135, in _lookup
    raise RuntimeError('object unbound')
RuntimeError: object unbound

The curious, is that when I use the Android library, this not happens, but I need use in Java only. I'm using Netbeans. The API that I using: https://www.odoo.com/documentation/11.0/webservices/odoo.html

0
Avatar
Opusti
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
Calculate taxes and confirm invoice with the API in JAVA
api java
Avatar
0
apr. 18
4979
Create Product via API Solved
product api
Avatar
Avatar
2
jul. 15
14322
java api Solved
api java
Avatar
Avatar
1
mar. 15
7057
How can we authenticate through our java dekstop application to our odoo server ?
api java desktop
Avatar
0
jun. 21
3249
OpenERP Java API Solved
api java webservices
Avatar
Avatar
Avatar
2
nov. 20
15563
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