Odoo Help


Debugging server action python code

Pascal Querner
on 6/26/14, 5:27 AM 2,679 views

How would one debug python code in server actions?

I've tried logging, warnings, exceptions and print. All don't work! :(

Daryl van Sittert
on 9/10/14, 3:30 AM

A colleague is also working on a separate effort to enable printing from within server actions.

Juan Rial (jri)
on 9/10/14, 12:22 PM
Juan Rial (jri)
On 9/10/14, 12:20 PM

I'm currently working on a module that does just that. My current patch got rejected on grounds of changing too much code for a rarely used feature, so we decided on a compromise which is to make it available as a module. The module still needs to be written, but if you require this in the meantime, you can look at my current patch at https://github.com/odoo/odoo/pull/2139 - the final module will use roughly the same logic, but it will dispense with the --debug-server-actions flag and use the already existing --debug flag instead.

That sounds great. Altough we're not using odoo (not because of that issue) anymore I am sure someone else is very happy about your efforts.

Pascal Querner
on 9/11/14, 4:42 AM

Leonardo Donelli

--Leonardo Donelli--
| 5 4 8
Roma, Italy
--Leonardo Donelli--

Physics student and part-time developer.

Leonardo Donelli
On 9/10/14, 4:49 AM

I'm afraid there is no easy way to do that. You could copy the python code in a method of the model the server action applies to, and call that method with the right ids and context.

Thanks. Do you execute this with a python server action or is there another way?

Daryl van Sittert
on 9/10/14, 6:30 AM

About This Community

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


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

3 follower(s)


Asked: 6/26/14, 5:27 AM
Seen: 2679 times
Last updated: 3/16/15, 8:10 AM