Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
5 ตอบกลับ
23877 มุมมอง

How to run debug mode using terminal ?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

You should do it as normal user (no root)

/usr/bin/odoo.py --log-level=debug

Robert

อวตาร
ละทิ้ง

I have Odoo running in terminal under the root user without a problem, this doesn't matter.

Anyway it should work regardless of the user type. In my case it works fine as a normal user :)

คำตอบที่ดีที่สุด

Hi,

Using the PDB you can debug the code via terminal.

Just add the below code in your method and you are able to debug the code.

import pdb
pdb.set_tracce()

Thanks

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

i did this. but its not working :

./odoo.py -c /etc/odoo-server.conf -d DB_name --log-level=debug

อวตาร
ละทิ้ง

Does it work when you only do ./odoo.py -d DB_name --log-level=debug?

ผู้เขียน

no its not work yenthe.:(

Alright so what do you get instead? Can you access the Odoo, does the terminal print something, ..? Just do a simple ./odoo.py --log-level=debug, that should always work.

ผู้เขียน

yes iam accessing odoo. but oly the debug not work in eclipse. :(

You're asking about using the debug mode with the terminal, right? I was assuming you where talking about debugging and printing in the Ubuntu command terminal? Where does Eclipse come from all of a sudden? If your question is about eclipse then change the question please.

ผู้เขียน

yes yenthe. in eclipse we can do debug mode right. the same process how we do debug using terminal. i need command line.

คำตอบที่ดีที่สุด

The problem might be with saving your previous configuration using -s in terminal.
check this: https://www.odoo.com/forum/help-1/question/loading-wrong-configuration-file-82480#answer-82481

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi Demirel,

Its rather easy. Simply open a terminal and navigate to your Odoo folder (where the odoo.py file is, something like /odoo/odoo-server/).
When you're there you can start your Odoo by command.

./odoo.py --log-level=debug 

After this your Odoo will print out all messages in the Ubuntu terminal.
If you get a warning about the Address already in use it means you have an automated Odoo startup or that your Odoo is already running. In that case do a ps aux, find the Odoo process and kill it with sudo kill -9 idOfYourOdooInstance.

Best of luck,
Yenthe

อวตาร
ละทิ้ง