ORM searching for calculated fields replaces query with 'True' with no warning
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Confirmed
|
Medium
|
OpenERP's Framework R&D |
Bug Description
If I make an or query like this with partner_ref as part of the search the ORM silently replaces the partner_ref part with an expression that evaluates to true. Since this is in an OR expression, this makes that whole part of the query redundant since anything OR TRUE is TRUE.
At the very least it would be useful if there was some debug output saying what the ORM is doing.
2012-08-16 10:49:00,507 12436 DEBUG ? openerp.
2012-08-16 10:49:00,508 12436 DEBUG ? openerp.
2012-08-16 10:49:00,508 12436 DEBUG ? openerp.
2012-08-16 10:49:00,508 12436 DEBUG ? openerp.
2012-08-16 10:49:00,508 12436 DEBUG ? openerp.
2012-08-16 10:49:00,508 12436 DEBUG ? openerp.
2012-08-16 10:49:00,508 12436 DEBUG ? openerp.
2012-08-16 10:49:00,508 12436 DEBUG ? openerp.
2012-08-16 10:49:00,508 12436 DEBUG ? openerp.
2012-08-16 10:49:00,508 12436 DEBUG ? openerp.
2012-08-16 10:49:00,509 12436 DEBUG ? openerp.
2012-08-16 10:49:00,509 12436 DEBUG ? openerp.
2012-08-16 10:49:00,509 12436 DEBUG ? openerp.
2012-08-16 10:49:00,509 12436 DEBUG ? openerp.
2012-08-16 10:49:00,509 12436 DEBUG ? openerp.
The code that does the replacement is in osv/expression.py and the code looks something like this,
It's actually done in a couple of places and I'm not entirely sure which one I'm hitting.
affects: | openobject-addons → openobject-server |
Changed in openobject-server: | |
assignee: | nobody → OpenERP's Framework R&D (openerp-dev-framework) |
importance: | Undecided → Medium |
status: | New → Confirmed |