Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
6150 Vistas

I'm trying to integrate odoo with an external application, that updates a custom url that I've given automatically, with XML data when an event occurs.

Suppose I hosted my odoo on https://mydomain.com, I can provide a custom url like https://mydomain.com/my/customurl

to that application, and that application will post an xml data to to the url. 

I can see that the url is actually called by the external application on status change, but how to view the xml data?

printing kwargs and args gave empty result. I think Odoo handles data with header  {"Content-Type": "application/json"} only. How to handle {"Content-Type": "text/xml"} data?

I know that data is present in the post request, which I've verified by giving a test url from https://requestbin.com which output the correct xml data in the body of the post request.

Any solutions or ideas are welcome. Odoo version is 11.

code :

from odoo import http
from odoo.http import request
import logging

class DocuSignStatus(http.Controller):

@http.route(['/docusign/envelope'], type='http', auth="public", methods=['POST'], csrf=False)
def update_docusign_status(self, *args, **kwargs):
    logging.error("\n\n\nCame in here!!!!!!!!!!!!!!!!!")
    for arg in args:
        logging.error("\nArgs = %s" % arg)
    logging.error("\n\n\nKwargs = %s" % kwargs)
    #        logging.error("request = %s" % request)
    #        logging.error("context = %s" % request.context)
    return {}

Avatar
Descartar
Mejor respuesta

print(request.httprequest.data)

will show the xml request data.

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
abr 22
18364
0
ene 22
2345
3
dic 23
4691
0
dic 22
2222
0
jul 20
3479