A simple Openerp module to add 'online' debug function, means you can run a console inside the openerp-server
when it is running. Useful for developers.
!!!Note that it is only useful for developing, not for production. Since it can easily crash your server, by simply:
have fun :)
Suppose openerp-server is installed at
$ cd /usr/share/pyshared/openerp-server/addons $ hg clone https://bitbucket.org/jayven/hotdebug hotdebug
Then goto the client and install the module in Administration->Modules.
After that, a new menu item should appear at Administration->Hot Debug.
This module does not create any new database tables.
Use the console just like a common python interactive shell and press 'save' (or ctrl+S) to send command to the shell.
Note: since Openerp strip spaces of the input, so you need some tricks sometimes. For example:
Predefined variables in the console:
|Current database's name|
|Current database's cursor. Most db function need this variable as the first argument|
|Current user's id. Most db function need this variable as the second argument|
|Object pool. Common usage to get an object: |
This tab shows the last exception caught, either from the console or from other modules (there are buttons to turn these feature on/off).
It is useful when you're debugging module that throw uncaught exception and don't know the traceback.
Also tracebacks can be export/import now.
Note: If there is an uncaught exception thrown from other modules, one need to press 'Refresh' button to display it since Openerp does not 'push event' to client.
Require the package
apt-get install python-profiler
Useful to find out which part (functions) take the most of time.
Note: during profiling, the server will become quite slow so be patience.