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

How can i debug odoo-8 while module development?

By
samba
on 1/13/15, 9:56 AM 2,138 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?

0
samba
On 2/4/15, 8:16 AM

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

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.

Stephen Mack
on 2/4/15, 10:37 AM

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.

samba
on 2/5/15, 12:40 AM
0
Hengky Zhang
On 1/14/15, 12:26 AM

if you want to debug perline of your code

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

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

samba
on 1/14/15, 12:28 AM

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

Hengky Zhang
on 1/15/15, 3:15 AM

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

Versão Integral, Anabela Damas
on 3/20/15, 8:19 AM
0

Yenthe

--Yenthe--
6716
| 7 7 8
Turnhout, Belgium
--Yenthe--

My Odoo blog: http://www.odoo.yenthevg.com/

My Twitter: https://twitter.com/Yenthe666

Yenthe
On 1/13/15, 9:59 AM

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:

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

samba
on 1/14/15, 12:19 AM

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.

Yenthe
on 1/14/15, 2:00 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

2 follower(s)

Stats

Asked: 1/13/15, 9:56 AM
Seen: 2138 times
Last updated: 3/16/15, 8:10 AM