Skip to content
Snippets Groups Projects
Commit a30e0380 authored by Martin Trigaux's avatar Martin Trigaux Committed by fw-bot
Browse files

[FIX] profiler: be more pesimistic


The profiler was too optimistic. If the local variable self was not a
cursor, it assumed it was automatically an Odoo model.
Instead, only do the custom tracer methods when self is an instance of
BaseModel.

Full scenario to reproduce explained at odoo/odoo#39237

In case a method like the default_get of utm.mixing was profiled, the
tracer crashed when evaluating `__bool__(request)`.
The tracer considered self as an Odoo model while it was a werkzeug
instance with its custom __getattr__ that crashed while trying to
retrieve the content of `_name`.

Fixes odoo/odoo#39237

closes odoo/odoo#39349

X-original-commit: 9d7147a3
Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parent 46b82f76
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment