c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #14825
[Bug 711919] [NEW] [TRUNK 3330] BUG in function parse when 2 condition and one of condion on one2many and other on active
Public bug reported:
sample of condition
[('category_id.code','=','PATIENT'),('active',=,False)]
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:
right1 = table.search(cr, uid, [(fargs[0],'in', right),active], context=context)
else:
right1 = table.search(cr, uid, [(fargs[0],'in', right)], context=context)
Note: in my example, Code is a field added in res.partner.category, so
to test it, bmaybe use field name.
** Affects: openobject-server
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/711919
Title:
[TRUNK 3330] BUG in function parse when 2 condition and one of condion
on one2many and other on active
Status in OpenERP Server:
New
Bug description:
sample of condition
[('category_id.code','=','PATIENT'),('active',=,False)]
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:
right1 = table.search(cr, uid, [(fargs[0],'in', right),active], context=context)
else:
right1 = table.search(cr, uid, [(fargs[0],'in', right)], context=context)
Note: in my example, Code is a field added in res.partner.category, so
to test it, bmaybe use field name.
Follow ups
-
[Bug 711919] Re: [TRUNK 3330] Search on mixed conditions including one2many and active=False is wrongly interpreted
From: Vo Minh Thu (OpenERP), 2011-10-06
-
[Bug 711919] Re: [TRUNK 3330] Search on mixed conditions including one2many and active=False is wrongly interpreted
From: Yogesh(Open ERP), 2011-06-03
-
[Bug 711919] Re: [TRUNK 3330] Search on mixed conditions including one2many and active=False is wrongly interpreted
From: Launchpad Bug Tracker, 2011-06-03
-
[Bug 711919] Re: [TRUNK 3330] Search on mixed conditions including one2many and active=False is wrongly interpreted
From: Yogesh(Open ERP), 2011-06-02
-
[Bug 711919] Re: [TRUNK 3330] Search on mixed conditions including one2many and active=False is wrongly interpreted
From: Serge, 2011-02-18
-
[Bug 711919] Re: [TRUNK 3330] BUG in function parse when 2 condition and one of condion on one2many and other on active
From: Olivier Dony (OpenERP), 2011-02-18
-
[Bug 711919] Re: [TRUNK 3330] BUG in function parse when 2 condition and one of condion on one2many and other on active
From: Vinay Rana (openerp), 2011-02-18
-
[Bug 711919] Re: [TRUNK 3330] BUG in function parse when 2 condition and one of condion on one2many and other on active
From: Serge, 2011-02-17
-
[Bug 711919] Re: [TRUNK 3330] BUG in function parse when 2 condition and one of condion on one2many and other on active
From: Serge, 2011-02-02
-
[Bug 711919] [NEW] [TRUNK 3330] BUG in function parse when 2 condition and one of condion on one2many and other on active
From: Serge, 2011-02-02
References