Skip to Content
Menu
This question has been flagged
4 Replies
4111 Views

I use the JSON webservice to connect my software to OpenERP. All my requests work fine except the cash.box.in create one.

{
"jsonrpc" : "2.0",
"method" : "call",
"params" : {
"model" : "cash.box.in",
"method" : "create",
"args" : [{
"name" : "Test CashDeposit",
"amount" : 10
}
],
"kwargs" : {
"context" : {
"lang" : "fr_FR",
"tz" : "Europe/Paris",
"uid" : 1,
"active_model" : "pos.session",
"active_id" : 5,
"active_ids" : [5],
"search_disable_custom_filters" : true
}
},
"session_id" : "e45ef0c92afa4f19af978fd3a1148793",
"context" : {
"lang" : "fr_FR",
"tz" : "Europe/Paris",
"uid" : 1
}
},
"id" : "r5"
}

In the server log I can read this line when I send the request : 

2016-01-15 19:57:19,559 9912 INFO db werkzeug: 127.0.0.1 - - [15/Jan/2016 19:57:19] "POST /web/dataset/call_kw HTTP/1.1" 200 -

I receive this response in my software : 

{"jsonrpc":"2.0","id":"r5","result":9}

When I see the current session in OpenERP my cash deposit doesn't appears.

What's wrong ? Should I send something else to create a cash deposit request ? Any idea to trace the problem ?

I can send a test software if needed.



EDIT ----------------------------------------------------------------------------------------

I don't find any solution.

Here are the log lines with debug_rpc_answer level.


With my software :

2016-02-10 00:27:09,348 5868 INFO database werkzeug: 192.168.1.4 - - [10/Feb/2016 00:27:09] "POST /web/dataset/call_kw HTTP/1.1" 200 -

2016-02-10 00:27:16,805 5868 DEBUG database openerp.netsvc.rpc.request: object.execute_kw(u'database',

2016-02-10 00:27:16,805 5868 DEBUG database openerp.netsvc.rpc.request: 1,

2016-02-10 00:27:16,805 5868 DEBUG database openerp.netsvc.rpc.request: '*',

2016-02-10 00:27:16,805 5868 DEBUG database openerp.netsvc.rpc.request: u'cash.box.out',

2016-02-10 00:27:16,806 5868 DEBUG database openerp.netsvc.rpc.request: 'create',

2016-02-10 00:27:16,806 5868 DEBUG database openerp.netsvc.rpc.request: ({u'amount': 27, u'name': u'Ajustement du fond de caisse'},),

2016-02-10 00:27:16,806 5868 DEBUG database openerp.netsvc.rpc.request: {u'context': {u'active_id': 22,

2016-02-10 00:27:16,806 5868 DEBUG database openerp.netsvc.rpc.request: u'active_ids': [22],

2016-02-10 00:27:16,806 5868 DEBUG database openerp.netsvc.rpc.request: u'active_model': u'pos.session',

2016-02-10 00:27:16,806 5868 DEBUG database openerp.netsvc.rpc.request: u'lang': u'fr_FR',

2016-02-10 00:27:16,806 5868 DEBUG database openerp.netsvc.rpc.request: u'search_disable_custom_filters': True,

2016-02-10 00:27:16,806 5868 DEBUG database openerp.netsvc.rpc.request: u'tz': u'Europe/Paris',

2016-02-10 00:27:16,806 5868 DEBUG database openerp.netsvc.rpc.request: u'uid': 1}})

2016-02-10 00:27:16,812 5868 DEBUG database openerp.netsvc.rpc.response: object.execute_kw time:0.006s mem: 65700k -> 65704k (diff: 4k)12L


With the included POS :

2016-02-10 00:30:14,168 5868 INFO database werkzeug: 192.168.1.4 - - [10/Feb/2016 00:30:14] "POST /web/dataset/call_kw HTTP/1.1" 200 -

2016-02-10 00:30:24,072 5868 DEBUG database openerp.netsvc.rpc.request: object.execute_kw(u'database',

2016-02-10 00:30:24,072 5868 DEBUG database openerp.netsvc.rpc.request: 1,

2016-02-10 00:30:24,072 5868 DEBUG database openerp.netsvc.rpc.request: '*',

2016-02-10 00:30:24,072 5868 DEBUG database openerp.netsvc.rpc.request: u'cash.box.out',

2016-02-10 00:30:24,072 5868 DEBUG database openerp.netsvc.rpc.request: 'create',

2016-02-10 00:30:24,072 5868 DEBUG database openerp.netsvc.rpc.request: ({u'amount': 27, u'name': u'Ajustement du fond de caisse'},),

2016-02-10 00:30:24,072 5868 DEBUG database openerp.netsvc.rpc.request: {u'context': {u'active_id': 22,

2016-02-10 00:30:24,072 5868 DEBUG database openerp.netsvc.rpc.request: u'active_ids': [22],

2016-02-10 00:30:24,072 5868 DEBUG database openerp.netsvc.rpc.request: u'active_model': u'pos.session',

2016-02-10 00:30:24,072 5868 DEBUG database openerp.netsvc.rpc.request: u'lang': u'fr_FR',

2016-02-10 00:30:24,072 5868 DEBUG database openerp.netsvc.rpc.request: u'search_disable_custom_filters': True,

2016-02-10 00:30:24,072 5868 DEBUG database openerp.netsvc.rpc.request: u'tz': u'Europe/Paris',

2016-02-10 00:30:24,072 5868 DEBUG database openerp.netsvc.rpc.request: u'uid': 1}})

2016-02-10 00:30:24,076 5868 DEBUG database openerp.netsvc.rpc.response: object.execute_kw time:0.005s mem: 65776k -> 65780k (diff: 4k)13L


Any idea to trace the python code and understand the problem?

Avatar
Discard
Best Answer

Hi Boris,

I also use the Web API to interact with an Odoo Server. When I'm facing issues like yours I activate the the rpc logging using following server command line options:

debug_rpc

debug_rpc_answer


Best regards

Yvan

Avatar
Discard
Best Answer

Hi! I recently faced the same issue when trying to create a cash in / cash out record using XMLRPC. Exploring the logs I noticed that cash.box.in create returns an id number (2016-02-10 00:30:24,076 5868 DEBUG database openerp.netsvc.rpc.response: object.execute_kw time:0.005s mem: 65776k -> 65780k (diff: 4k)13L in your logs), that then needs to be run (using cash.box.in run ID) for it to be registered in the cash log / pos session.


The structure should be like this:

{ "jsonrpc" : "2.0", "method" : "call", "params" : { "model" : "cash.box.in", "method" : "run", "args" : [[CASH.BOX.IN/OUT CREATED ID]], "kwargs" : { "context" : { "lang" : "fr_FR", "tz" : "Europe/Paris", "uid" : 1, "active_model" : "pos.session", "active_id" : 5, "active_ids" : [5], "search_disable_custom_filters" : true } }, "session_id" : "e45ef0c92afa4f19af978fd3a1148793", "context" : { "lang" : "fr_FR", "tz" : "Europe/Paris", "uid" : 1 } }, "id" : "r5"}


Hope this helps.

Avatar
Discard
Author Best Answer

Hi Yvan,

Thank you for your answer.

I don't find how to enable debug_rpc on my serveur. I use the OpenERP Windows version...

I tried to add the parameter in the service but it seems not working?

Any idea ?

Avatar
Discard

Hi Boris, actually Windows is not my world, I always use Linux. I installed the Windows Version of Odoo 8.0 on Windows machine and found out how to enable the rpc logging. 1. Stop the Odoo service 2. Open the Windows command prompt (cmd.exe) 3. Change to the Odoo install directory (in my case "cd c:\program Files (x86)\Odoo 8.0-20160116\server") 4. Start the Odoo Server with following command: "odoo.exe --logfile odoo.log --log-level debug_rpc_answer" 5. Open the log file odoo.log to scroll through the debug messages Hope it will help Best regards Yvan

Related Posts Replies Views Activity
0
Mar 17
3268
0
Jun 20
2538
1
May 21
6640
1
Jul 17
4900
1
Jun 24
425