Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Intelligence artificielle
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Supermarché
    • Quincaillerie
    • Magasin de jouets
    Restauration & Hôtellerie
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brasserie
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Commerce
    • Homme à tout faire
    • Matériel informatique & support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Parcourir toutes les industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenir partenaire
    • Services pour partenaires
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

Problem with api button_validate of stock.picking

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
validatejava
1 Répondre
8114 Vues
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
Ignorer
Avatar
Pine Nguyen
Auteur Meilleure réponse

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
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
Does Odoo Have Any Validation Documentation?
validate
Avatar
Avatar
1
sept. 23
3695
What is the correct way to filter by state and id? (java example)
java
Avatar
0
août 22
3841
Call a new public method via xml rpc Résolu
java
Avatar
Avatar
1
déc. 19
13389
How to make a field must be validate when I use import function?
validate
Avatar
Avatar
2
mars 18
8019
Using OpenERP XML-RPC API with Java
java
Avatar
Avatar
1
mars 15
19733
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenir partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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