跳至内容
菜单
此问题已终结
1 回复
7499 查看

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

形象
丢弃
最佳答案

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

形象
丢弃
相关帖文 回复 查看 活动
1
9月 20
6280
6
7月 20
11393
1
3月 20
3418
5
1月 20
9369
0
3月 17
4356