Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
1322 Tampilan

I'm troubleshooting an issue in Odoo's Accounting module and need to track the exact SQL queries executed when creating, modifying, or posting invoices, journal entries, and payments.

  • How can I enable logging to capture these queries?
  • Are there specific settings or modules in Odoo that allow SQL debugging for accounting-related transactions?
  • Can PostgreSQL logs or Odoo's built-in logging be configured to filter only queries related to the account.move and account.move.line tables?

I'm using Odoo 16.0 on Odoo.sh. 

Any advice on the best approach to capture and analyze these SQL queries would be appreciated!

Avatar
Buang

very usefull @ray Carnes

Jawaban Terbai

1) Connect to a STAGING branch of Odoo.sh (where you can modify the configuration file to trigger logging)

  • this step just ensures there are active Workers started

2) Connect to the Terminal via the SHELL tab, and start nano (a text editor) and open the Odoo configuration file:

nano ./.config/odoo/odoo.conf


3) Cursor down in the file and add the following two lines:

log_level=debug_sql

log_handler=odoo.addons.account:DEBUG


4) Use CTRL-O and ENTER to save the changes, then CTRL-X to exit


5) Restart Odoo:

odoosh-restart http


6) Open the logfile

lnav ~/logs/odoo.log


7) Review it while using Odoo, potentially using timestamps to quickly locate the place where Odoo is responding to what you are doing in the UI and logging the SQL:


You can also review the log files via the LOGS tab if that's easier

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
0
Mar 15
4428
0
Sep 22
6557
1
Feb 18
10474
1
Apr 25
14241
4
Mar 21
6395