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

Debugging server action python code

By
Pascal Querner
on 6/26/14, 5:27 AM 1,723 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
1
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
0

Leonardo Donelli

--Leonardo Donelli--
1040
| 5 4 8
Cave, 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

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

3 follower(s)

Stats

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