From 9cb3205a6432ccc7ba2458416786774b39bc50d6 Mon Sep 17 00:00:00 2001 From: "Yogesh (OpenERP)" Date: Fri, 3 Jun 2011 15:25:26 +0530 Subject: [PATCH] [FIX] fix problem of search multiple conditions O2M with active=False then not work. lp bug: https://launchpad.net/bugs/711919 fixed bzr revid: ysa@tinyerp.com-20110603095526-s26wgkahwc1d6zfd --- openerp/osv/expression.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/openerp/osv/expression.py b/openerp/osv/expression.py index 1922d5e8388..4c74a11506a 100644 --- a/openerp/osv/expression.py +++ b/openerp/osv/expression.py @@ -108,6 +108,10 @@ class expression(object): self.__main_table = table self.__all_tables.add(table) + active = False + for exp in self.__exp: + if exp[0] == 'active': + active = exp i = -1 while i + 1','<=','>='] ) and 'in' or operator - + dict_op = {'not in':'!=','in':'=','=':'in','!=':'not in','<>':'not in'} if isinstance(right,tuple): right = list(right) @@ -319,7 +326,7 @@ class expression(object): elif isinstance(right,(list,tuple)): m2o_str = True for ele in right: - if not isinstance(ele, basestring): + if not isinstance(ele, basestring): m2o_str = False break elif right == []: @@ -335,7 +342,7 @@ class expression(object): new_op = '!=' #Is it ok to put 'left' and not 'id' ? self.__exp[i] = (left,new_op,False) - + if m2o_str: self.__exp[i] = _get_expression(field_obj,cr, uid, left, right, operator, context=context) else: