콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
6 답글
17397 화면

Hi everyone,

I'd like to know how to start odoo server (8.0RC1, as title says) on debug mode in order to use python's pdb.

I have tried a few things and none of them do the trick.

Any help would be appreciated.

아바타
취소

Please use a question instead of 'Odoo 8.0RC1' as your title - this tells readers nothing about your problem and forces them to open it to find out. You will increase the chances that someone actually reads your question if you construct your title as a question - like I have changed it to "How do I ..."

베스트 답변

Use default python debugger, pdb. Place it in the addons where your code will start execution. 

Just write 

import pdb;pdb.set_trace()

when you write this line your screen will hold and then you can start debugging line by line using tools provided by pdb. Before starting please do read about the python pdb.

https://www.tutorialspoint.com/the-python-debugger-pdb

아바타
취소
베스트 답변

Debug mode

According to odoo.py --help

--debug             enable debug mode

so start odoo with

odoo.py --debug

 

PDB

You have to edit the python file you want to debug by adding a breakpoint with

import pdb

pdb.set_trace()

and start odoo normally.

아바타
취소
작성자

Thank you for commenting. What I'm trying to figure out is how to start the server on debug mode: i already know how to use a pdb (been using it on previous versions). What I can't seem to achieve is to start odoo server on debug mode.

베스트 답변

import pdb

whitch line in to breackpoint (debug mode start) you want, before Add this line  pdb.set_trace()

  • In terminal side 

"S"  for Next step

Execute the current line, stop at the first possible occasion (either in a function that is called or on the next line in the current function).

"N" for next line

Continue execution until the next line in the current function is reached or it returns. (The difference between next and step is that step stops inside a called function, while next executes called functions at (nearly) full speed, only stopping at the next line in the current function.)

아바타
취소
작성자

Thank you for commenting. What I'm trying to figure out is how to start the server on debug mode: i already know how to use a pdb (been using it on previous versions). What I can't seem to achieve is to start odoo server on debug mode.

관련 게시물 답글 화면 활동
4
12월 19
11208
2
3월 15
5246
0
9월 21
7
0
9월 20
3893
4
1월 16
4661