2013-05-23 2 views
0

나는 SQL과 관련하여 연산자 ilike를 이미 알고 있습니다. ilike 운영자가 openerp 7에서 다르게 수행

'PSS01' ilike 'pss01' -> will return true 
'PSS01' ilike '%ss01' -> will return true 
'PSS01' ilike 'ss01' -> will return false 

그러나 openerp 7 클래스

, 그것은 사람이 도와 드릴

'PSS01' ilike 'pss01' -> returns true 
'PSS01' ilike 'ss01' -> returns true **(it should return false)** 

내 코드가

repeted_ids = prod_serial_obj.search(cr, uid, ['&',('name', 'ilike', line.prod_ser_no),('product_id', '=', product_id)]) 

아래에이 방법을 수행한다에 배치 할 때이 방법을 수행합니다?

답변

1

OpenERP는 백분율 (%) 안에 ilike 연산자의 오른쪽 값을 자동으로 래핑합니다. 도메인을 쓸 때 그래서

[('name', 'ilike', 'ss01')] 

추가이 와일드 카드 문자를 피하기 위해

name ilike '%ss01%' 

로 변환 OpenERP, 당신은 =ilike 연산자를 사용합니다.

[('name', '=ilike', 'ss01')] 

name ilike 'ss01' 
로 변환됩니다
관련 문제