Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Artificial Intelligence
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Property Management
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Problem with api button_validate of stock.picking

Subscriure's

Get notified when there's activity on this post

This question has been flagged
validatejava
1 Respondre
8043 Vistes
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
Descartar
Avatar
Pine Nguyen
Autor 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
Descartar
Enjoying the discussion? Don't just read, join in!

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

Registrar-se
Related Posts Respostes Vistes Activitat
Does Odoo Have Any Validation Documentation?
validate
Avatar
Avatar
1
de set. 23
3645
What is the correct way to filter by state and id? (java example)
java
Avatar
0
d’ag. 22
3805
Call a new public method via xml rpc Solved
java
Avatar
Avatar
1
de des. 19
13322
How to make a field must be validate when I use import function?
validate
Avatar
Avatar
2
de març 18
7987
Using OpenERP XML-RPC API with Java
java
Avatar
Avatar
1
de març 15
19691
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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