Hello,
I'm trying to update a product but I can't find the correct JSON structure to do it. Here is what I've tried:
{
"jsonrpc": "2.0",
"method": "call",
"params": {
"model": "product.product",
"ids": [
77
],
"vals": {
"name_template": "Coca-Cola 50cl OK"
},
"context": {},
"session_id": "f48b00a031fc4920af0b3e4ec04d9497"
},
"id": "r6"
}
on this URL: /web/dataset/write
All my "search_read" requests are working normaly but I need your help for the "write" one.
Could you help me?
-- Edit ----------
When I enabled the debug-rpc log level I can see that:
2014-04-28 19:58:13,507 7104 INFO ? werkzeug: 127.0.0.1 - - [28/Apr/2014 19:58:13] "POST /web/dataset/write HTTP/1.1" 404 -
The URL for write data seems to be false... Does someone knows it ?
-- Edit ----------
I've tried to edit my product through OpenERP web interface to see the log...
2014-04-28 20:26:50,864 7104 DEBUG database openerp.netsvc.rpc.request: object.execute_kw time:0.373s mem: 49368k -> 49452k (diff: 84k)(u'database', 1, '*', u'product.product', 'write', (...), {...})
2014-04-28 20:26:51,012 7104 INFO database werkzeug: 127.0.0.1 - - [28/Apr/2014 20:26:51] "POST /web/dataset/call_kw HTTP/1.1" 200 -
It seems send the request at /web/dataset/call_kw so when I send my request to this URL I receive this answer:
2014-04-28 20:52:41,036 7104 ERROR database openerp.addons.web.http.JSONRequest.dispatch: An error occured while handling a json request
Traceback (most recent call last):
File "C:\Program Files (x86)\OpenERP 7.0\Server\server\openerp\addons\web\http.py", line 204, in dispatch
TypeError: call_kw() got an unexpected keyword argument 'vals'
2014-04-28 20:52:41,184 7104 INFO database werkzeug: 127.0.0.1 - - [28/Apr/2014 20:52:41] "POST /web/dataset/call_kw HTTP/1.1" 200 -
An idea to solve my problem ?
Thanks.
Same problem..... Do you get any solution????
Same problem..... Do you get any solution????
hii i solve this prob... You are passing wrong string follow this link http://gauravsahu.github.io/odoo-client-JSON-RPC/