[TRUNK 3330] Search on mixed conditions including one2many and active=False is wrongly interpreted
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Fix Released
|
Low
|
OpenERP's Framework R&D |
Bug Description
sample of condition
[('category_
Description
When server parse
1 = search all partner with category code = patient , and add active = True
2= search all partner active = False
Result = Found nothing, because active condiction not used in one2many search
My solution (not the optimal solution, no time to do it)
before line 111 (i = -1)
add
active = False
for exp in self.__exp:
if exp[0] == 'active':
active = exp
replace line 153 (right1 = table.search(cr, uid, [(fargs[0],'in', right)], context=context))
by
if active:
Note: in my example, Code is a field added in res.partner.
Related branches
- Vo Minh Thu (community): Needs Fixing
- Yogesh (SerpentCS) (community): Needs Resubmitting
- Naresh(OpenERP) (community): Needs Fixing
-
Diff: 68 lines (+23/-5)2 files modifiedopenerp/addons/base/test/test_osv_expression.yml (+18/-0)
openerp/osv/expression.py (+5/-5)
Changed in openobject-server: | |
status: | New → Triaged |
Changed in openobject-server: | |
status: | Confirmed → In Progress |
forget
in server/ bin/osv/ expression. py
Class expression, method parse