Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
1448 Vistas

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
Descartar

very usefull @ray Carnes

Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
mar 15
4576
0
sept 22
6623
1
feb 18
10598
1
abr 25
14373
4
mar 21
6496