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.

0

Unable to use cash.box.in create webservice command

By
Tillt
on 1/15/16, 3:06 PM 387 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?

1
Yvan
On 1/16/16, 4:52 AM

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

0
Tillt
On 1/16/16, 7:07 AM

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 ?

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

Yvan
on 1/16/16, 3:50 PM

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: 1/15/16, 3:06 PM
Seen: 387 times
Last updated: 2/9/16, 7:42 PM