Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I'm writing a controller function that accepts post requests. I need to get the data from the post in the order it was sent to me. It seems like this is possible in werkzeug, by changing the class that the request object uses to store post data, but I can't get it to work in Odoo. I've tried something along these lines:
request.httprequest.parameter_storage_class = werkzeug.datastructures.ImmutableOrderedMultiDict
_logger.warn('form data: %s' % request.httprequest.form)
This outputs the post data, but it's still in the form of an ImmutableMultiDict, not the ordered one.
You could access to the POST data from the request stream like:
post_data = simplejson.load(request.httprequest.stream)
In this case I parsed into a dict using simplejson, you could read the stream using what best fit your needs since it's a file-like object. Read more at:
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 10/20/15, 1:42 PM|
|Seen: 1619 times|
|Last updated: 10/22/15, 2:18 AM|