Skip to Content
Menu
This question has been flagged
1 Reply
1314 Views

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
Discard

very usefull @ray Carnes

Best Answer

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
Discard
Related Posts Replies Views Activity
0
Mar 15
4422
0
Sep 22
6546
1
Feb 18
10467
1
Apr 25
14227
4
Mar 21
6379