Odoo Help

Welcome!

This community 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.

2

JSON-RPC dont use context (return datetime gmt and lang per default)

By
Juanjo
on 5/18/15, 9:00 AM 662 views

Hi, I try to connect mobile apps to openerp 7 / odoo 8 with JSON-RPC

When I read data, the fields returned are the values without apply context (language and time zone).

I use http://www.mydomain.com/web/dataset/search_read

Maybe I can use other url for this?

How to obtain values using the context?

The json to search is similar to this:



{

        "jsonrpc": "2.0",

        "method": "call",

        "params": {

                "session_id": "c2ca1485aaseddsfggfgafd333",

                "context": {

                            "lang": "es_ES",

                            "tz": "Europe/Madrid", 

                            "uid": 3

                },

                "model": "crm.claim",

                "limit": 2,

                "domain": "",

                "sort": "write_date desc"

            }

}


But the returned values are datetime gmt:


{

        "jsonrpc": "2.0",

        "id": null,

        "result": {

                "records": [

                    {

                        "date_closed": false,

                        "message_follower_ids": [],

                        "create_date": "2015-03-20 10:27:54",       <--- 

                        "employee_ids": [],

                        "contact_id": [

                            3506,

                    ........


On web client:

        Fecha de creación:      20/03/2015 11:27:54

 

Ideas  are welcome!

Thx

0
陈帆
On 6/27/16, 7:45 AM

最后一个 参数 以  dict 的方式 传递  {  'context': {}} 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 5/18/15, 9:00 AM
Seen: 662 times
Last updated: 6/27/16, 7:45 AM