openerp中ORM搜索方法中不区分大小写

时间:2022-04-26 00:43:19

I have problem with non-case-sensitive in ORM method in OpenERP. I search the duplicate rows in the database as follow:

在OpenERP中,我对ORM方法的非区分大小写有问题。我在数据库中搜索重复的行如下:

    duplicate_ids = sns_obj.search(cr, uid, [('country_id', '=', country_id),
('keyword_list', '=', final_str), ('origin', '=', origin)])

How can I search in the database without caring about the case-sensitive

如何在不关心大小写敏感的情况下搜索数据库

Ex: in Country_ID, "Vietnam" = "vietnam" or something like that

Thanks

谢谢

1 个解决方案

#1


2  

the solution to your problem is operator ilike

解决你的问题的办法是像操作人员一样

duplicate_ids = sns_obj.search(cr, uid, [('country_id', 'ilike', country_id),
('keyword_list', 'ilike', final_str), ('origin', 'ilike', origin)])

#1


2  

the solution to your problem is operator ilike

解决你的问题的办法是像操作人员一样

duplicate_ids = sns_obj.search(cr, uid, [('country_id', 'ilike', country_id),
('keyword_list', 'ilike', final_str), ('origin', 'ilike', origin)])