Skip to Content
Menu
This question has been flagged
3 Replies
8057 Views

I want to develop a module in odoo-8. I odoo-7, i used print statement to debug or print the variable. I want to use log in terminal. How can i run odoo-8, to see print statement in terminal?

Avatar
Discard
Author Best Answer

Navigate to odoo-server folder and run this command ./odoo.py --addons-path=addons/,../custom/addons/

Avatar
Discard

Sorry but I don't see how that will log your debug statements. Can you please explain your answer a little bit better. I would like to understand.

Author

Hi Stephen, While i am developing modules in odoo-7, most of cases i use print statement to debug my module. But in odoo-8 i did not get logs on terminal, i have to go var/log/odoo/log file to see output. I did not see print statement output there, for that i have to use _logger.info/_logger.debug statement. This logging process little bit uncomfortable to me. That's why i have asked in forum like odoo-7 server running process.

Best Answer

if you want to debug perline of your code

you can try function pdb.set_trace() function
from pdb module

Avatar
Discard
Author

Thank you Hengky, Can you give me any idea how can i use this in odoo debugging?

https://docs.python.org/2/library/pdb.html

In v8 the pdb is not working properly, the arrows don't work , I cannot edit the line .... Do you have a solution ?

Best Answer

Hi Samba 

Simply do this command to start up Odoo with logging in the terminal:

./openerp-server --log-level=debug

This will print out debug statements like these:

Avatar
Discard
Author

Thank you Yenthe, tried the above command. When i goto "localhost:8069" it is showing below error. 2015-01-14 05:13:25,926 2982 INFO ? openerp: addons paths: ['/home/samba/.local/share/Odoo/addons/8.0', u'/home/samba/odoo-7/addons', u'/home/samba/odoo-7/custom_modules', '/opt/odoo/odoo-server/openerp/addons'] 2015-01-14 05:13:25,926 2982 INFO ? openerp: database hostname: localhost 2015-01-14 05:13:25,926 2982 INFO ? openerp: database port: 5432 2015-01-14 05:13:25,926 2982 INFO ? openerp: database user: samba 2015-01-14 05:13:25,927 2982 WARNING ? openerp.modules.module: module web: module not found 2015-01-14 05:13:25,927 2982 CRITICAL ? openerp.modules.module: Couldn't load module web 2015-01-14 05:13:25,927 2982 CRITICAL ? openerp.modules.module: No module named web 2015-01-14 05:13:25,927 2982 ERROR ? openerp.service.server: Failed to load server-wide module `web`. The `web` module is provided by the addons found in the `openerp-web` project. Maybe you forgot to add those addons in your addons_path configuration. Traceback (most recent call last): File "/opt/odoo/odoo-server/openerp/service/server.py", line 850, in load_server_wide_modules openerp.modules.module.load_openerp_module(m) File "/opt/odoo/odoo-server/openerp/modules/module.py", line 312, in load_openerp_module __import__('openerp.addons.' + module_name) File "/opt/odoo/odoo-server/openerp/modules/module.py", line 76, in load_module f, path, descr = imp.find_module(module_part, ad_paths) ImportError: No module named web 2015-01-14 05:13:25,958 2982 WARNING ? openerp.modules.module: module web_kanban: module not found 2015-01-14 05:13:25,958 2982 CRITICAL ? openerp.modules.module: Couldn't load module web_kanban 2015-01-14 05:13:25,958 2982 CRITICAL ? openerp.modules.module: No module named web_kanban 2015-01-14 05:13:25,958 2982 ERROR ? openerp.service.server: Failed to load server-wide module `web_kanban`. Traceback (most recent call last): File "/opt/odoo/odoo-server/openerp/service/server.py", line 850, in load_server_wide_modules openerp.modules.module.load_openerp_module(m) File "/opt/odoo/odoo-server/openerp/modules/module.py", line 312, in load_openerp_module __import__('openerp.addons.' + module_name) File "/opt/odoo/odoo-server/openerp/modules/module.py", line 76, in load_module f, path, descr = imp.find_module(module_part, ad_paths) ImportError: No module named web_kanban 2015-01-14 05:13:25,958 2982 DEBUG ? openerp.service.server: Setting signal handlers 2015-01-14 05:13:25,959 2982 INFO ? openerp.service.server: HTTP service (werkzeug) running on 0.0.0.0:8069 "I have tried the command " ./openerp-server --addons /opt/odoo/odoo-server/addons/,/opt/odoo/custom/addons --log-level=debug " " but no use.. It is showing below error ProgrammingError: permission denied for relation ir_module_module

Hmm this error is basicly telling you that it cannot find the 'web' module. I presume you've placed it under another folder / in another folder or messed the structure of the module up. This is the reason why your Odoo is failing and that is giving you the permission denied warning.