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
    • Artificial Intelligence
    • 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
    • Property 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č
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č

Problem with api button_validate of stock.picking

Naroči se

Get notified when there's activity on this post

This question has been flagged
validatejava
1 Odgovori
8123 Prikazi
Avatar
Pine Nguyen

I had use Java to interactive with api call_button.

When I use postman to Post this cURL, it is require only Id of Delivery Orders (1199)


curl --location --request POST 'https://stag-odoo.crosspanda.com/web/dataset/call_button' \

--header 'authority: stag-odoo.crosspanda.com' \

--header 'accept: application/json, text/javascript, */*; q=0.01' \

--header 'x-requested-with: XMLHttpRequest' \

--header 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36' \

--header 'content-type: application/json' \

--header 'origin: https://stag-odoo.crosspanda.com' \

--header 'sec-fetch-site: same-origin' \

--header 'sec-fetch-mode: cors' \

--header 'sec-fetch-dest: empty' \

--header 'referer: https://stag-odoo.crosspanda.com/web?' \

--header 'accept-language: vi,en-US;q=0.9,en;q=0.8' \

--header 'cookie: _hjid=836b8983-c312-414e-b609-971656781304; __cfduid=ddc875cf512b6cd4bf6dcfdc00507f0b51602652130; session_id=823b706e981832b24aba25967980f4097548ef1f; _hjTLDTest=1; crisp-client%2Fsession%2Ff757cc9f-4cbf-4d61-80eb-425295250e4c=session_9a7ed057-9b7a-48c5-96a2-c1017fe4973e; session_id=823b706e981832b24aba25967980f4097548ef1f' \

--data-raw '{"jsonrpc":"2.0","method":"call","params":{"args":[[1199]],"method":"button_validate","model":"stock.picking"},"id":450789143}'

----------------------------------------------------------------------------------------

But when I use Java, it return this message


Traceback (most recent call last):

  File "/usr/lib/python3.5/xmlrpc/client.py", line 509, in __dump

    f = self.dispatch[type(value)]

KeyError: <class 'odoo.tools.misc.frozendict'>


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "/usr/lib/python3/dist-packages/odoo/addons/base/controllers/rpc.py", line 69, in xmlrpc_2

    response = self._xmlrpc(service)

  File "/usr/lib/python3/dist-packages/odoo/addons/base/controllers/rpc.py", line 50, in _xmlrpc

    return dumps((result,), methodresponse=1, allow_none=False)

  File "/usr/lib/python3.5/xmlrpc/client.py", line 951, in dumps

    data = m.dumps(params)

  File "/usr/lib/python3.5/xmlrpc/client.py", line 501, in dumps

    dump(v, write)

  File "/usr/lib/python3.5/xmlrpc/client.py", line 523, in __dump

    f(self, value, write)

  File "/usr/lib/python3.5/xmlrpc/client.py", line 594, in dump_struct

    dump(v, write)

  File "/usr/lib/python3.5/xmlrpc/client.py", line 519, in __dump

    raise TypeError("cannot marshal %s objects" % type(value))

TypeError: cannot marshal <class 'odoo.tools.misc.frozendict'> objects


I think it is not my fail.

Please help me.

Thank you so much!

0
Avatar
Opusti
Avatar
Pine Nguyen
Avtor Best Answer

client.doRequest("stock.picking", "button_validate", asList(asList(1199)), null);

client.doRequest("stock.immediate.transfer", "process", asList(asList(2579)), null);

Action 2 can run normally, but action 1 can not.

This is code of doRequest

public Object doRequest(String model, String method, List args, List<String> fields) throws XmlRpcException {

        XmlRpcClient models = new XmlRpcClient() {

            {

                setConfig(new XmlRpcClientConfigImpl() {{

                    try {

                        setServerURL(new URL(String.format("%s/xmlrpc/2/object", url)));

                    } catch (MalformedURLException e) {

                        e.printStackTrace();

                    }

                }});

            }

        };

        System.out.println(url);

        return models.execute("execute_kw", asList(database, uid, password, model, method, args, new HashMap() {{

            if (fields != null) {

                put("fields", fields);

            }

        }}));

    }



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
Does Odoo Have Any Validation Documentation?
validate
Avatar
Avatar
1
sep. 23
3709
What is the correct way to filter by state and id? (java example)
java
Avatar
0
avg. 22
3850
Call a new public method via xml rpc Solved
java
Avatar
Avatar
1
dec. 19
13396
How to make a field must be validate when I use import function?
validate
Avatar
Avatar
2
mar. 18
8029
Using OpenERP XML-RPC API with Java
java
Avatar
Avatar
1
mar. 15
19740
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 Svenska ภาษาไทย 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