server-tools icon indicating copy to clipboard operation
server-tools copied to clipboard

[15.0][ADD] server_action_logging

Open vvrossem opened this issue 1 year ago • 2 comments

source PR: https://github.com/OCA/server-tools/pull/2945

vvrossem avatar May 30 '24 09:05 vvrossem

@SilvioC2C, any idea how to fix the following error?

 2024-05-30 09:35:24,446 473 INFO odoo odoo.addons.server_action_logging.tests.test_server_action_logging: ====================================================================== 
2024-05-30 09:35:24,446 473 ERROR odoo odoo.addons.server_action_logging.tests.test_server_action_logging: FAIL: TestServerActionLogging.test_01_log_action_sql_db
Traceback (most recent call last):
  File "/__w/server-tools/server-tools/server_action_logging/tests/test_server_action_logging.py", line 83, in test_01_log_action_sql_db
    self.action_with_sql_log.run()
AssertionError: no logs of level DEBUG or higher triggered on odoo.sql_db

vvrossem avatar May 30 '24 09:05 vvrossem

@vvrossem you can try this:

  1. change server_action_logging/tests/test_server_action_logging.py:L83 with self.action_with_sql_log.with_context(test=1).run()
  2. in server_action_logging/models/ir_actions_server.py, before the for act in actions: loop, add this:
        res = False
        if self._context.get("test"):
            import pdb
            pdb.set_trace()
        for act in actions:

Then, through the PDB shell, you should be able to check the odoo.sql_db level configuration and check why it's failing.

SilvioC2C avatar May 30 '24 10:05 SilvioC2C