How would one debug python code in server actions?
Cette question a été signalée
2
Réponses
10106
Vues
How would one debug python code in server actions?
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.
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?
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrire| Publications associées | Réponses | Vues | Activité | |
|---|---|---|---|---|
|
|
1
juin 15
|
5552 | ||
|
|
0
mars 26
|
9 | ||
|
|
1
mai 24
|
2134 | ||
|
|
3
juin 23
|
15088 | ||
|
|
4
mars 22
|
14546 |
I've tried logging, warnings, exceptions and print. All don't work! :(
A colleague is also working on a separate effort to enable printing from within server actions.