コンテンツへスキップ
Odoo メニュー
  • サインイン
  • 無料で15日試す
  • アプリ
    財務
    • 会計
    • 請求
    • 経費
    • スプレッドシート(BI)
    • ドキュメント管理
    • 署名
    販売
    • CRM
    • 販売
    • POS店舗
    • POSレストラン
    • サブスクリプション
    • レンタル
    ウェブサイト
    • ウェブサイトビルダー
    • eコマース
    • ブログ
    • フォーラム
    • ライブチャット
    • eラーニング
    サプライチェーン
    • 在庫
    • 製造
    • 製品ライフサイクル管理 (PLM)
    • 購買
    • 整備
    • 品質
    人事業務
    • 従業員管理
    • 採用
    • 休暇管理
    • 人事評価
    • リファラル
    • フリート
    マーケティング
    • ソーシャルマーケティング
    • メールマーケティング
    • SMSマーケティング
    • イベント
    • マーケティングオートメーション
    • アンケート調査
    サービス
    • プロジェクト管理
    • タイムシート
    • フィールドサービス
    • ヘルプデスク
    • 計画
    • アポイントメント
    生産性向上ツール
    • ディスカッション
    • 承認
    • IoT
    • VoIP
    • ナレッジ
    • WhatsApp
    サードパーティアプリ Odooスタジオ Odooクラウドプラットホーム
  • インダストリー(業種別ソリューション)
    小売
    • 書店
    • アパレルショップ
    • 家具専門店
    • 食料品店
    • 金物店
    • 玩具店
    飲食・ホスピタリティ業界
    • バー・パブ
    • レストラン
    • ファストフード
    • ゲストハウス
    • 飲料販売代理店
    • ホテル
    不動産
    • 不動産会社
    • 建築事務所
    • 建設
    • 不動産管理
    • 造園
    • 住宅所有者組合
    コンサルティング
    • 会計事務所
    • Odooパートナー
    • マーケティングエージェンシー
    • 法律事務所
    • 人材派遣
    • 監査・認証
    製造
    • テキスタイル
    • 金属
    • 家具
    • 飲食
    • 醸造所
    • コーポレートギフト
    ヘルス & フィットネス
    • スポーツクラブ
    • 眼鏡店
    • フィットネスセンター
    • ウェルネス専門家
    • 薬局
    • ヘアサロン
    業種
    • 便利屋
    • IT ハードウェア・サポート
    • 太陽エネルギーシステム
    • 靴メーカー
    • クリーニングサービス
    • 空調設備サービス
    その他
    • 非営利団体
    • 環境機関
    • ビルボードレンタル
    • 写真
    • 自転車リース
    • ソフトウェアリセラー
    すべての業種を見る
  • コミュニティ
    学ぶ
    • チュートリアル
    • ドキュメンテーション
    • 認定
    • トレーニング
    • ブログ
    • ポッドキャスト
    教育サポート
    • 教育プログラム
    • Scale Up! ビジネスゲーム
    • Odooオフィス訪問
    ソフトを入手
    • ダウンロード
    • エディションを比較
    • リリース
    コラボレーション
    • Github
    • フォーラム
    • イベント
    • 翻訳
    • パートナーになる
    • パートナー様向けサービス
    • 会計事務所を登録
    サービス利用
    • パートナー一覧
    • 会計事務所一覧
    • 今すぐ相談する
    • 導入支援サービス
    • お客様一覧
    • サポート
    • アップグレード
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    製品デモを利用する
  • 料金
  • ヘルプ

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • 会計
  • 在庫
  • PoS
  • プロジェクト
  • MRP
All apps
コミュニティで交流するには登録する必要があります。
全てのポスト 人々 バッジ
タグ (全て表示)
odoo accounting v14 pos v15
このフォーラムについて
コミュニティで交流するには登録する必要があります。
全てのポスト 人々 バッジ
タグ (全て表示)
odoo accounting v14 pos v15
このフォーラムについて
ヘルプ

[SOLVED] What does "=ilike" in domain operator used for?

購読

この投稿に活動があった際に通知を受け取ります

この質問にフラグが付けられました
5 返信
116590 ビュー
アバター
Atchuthan - Technical Consultant, Sodexis Inc

In what scenarios would we need to use '=ilike' in domain operation.

When we create a domain, we have multiple operators available in OpenERP 7 at server/openerp/osv/expression.py

TERM_OPERATORS = ('=', '!=', '<=', '<', '>', '>=', '=?', '=like', '=ilike', 'like', 'not like', 'ilike', 'not ilike', 'in', 'not in',  'child_of')

Can anyone provide me a scenario where we need to use these operators in domain:

1. =?
2. =like
3. =ilike
4. like
5. ilike
6. child_of

 

10
アバター
破棄
アバター
René Schuster
最善の回答

As prakash says: The i is for case insensitive. While the "= prefix" searches for exact matching. Without the "= prefix", the orm will add % wildcards arround your search term.

Examples:

[('name', 'like', 'dog')]

This will find recods with name 'dog', 'dogs', 'bulldog', ... but not 'Dog'.

[('name', '=like', 'dog')]

This will find records with name 'dog' (it's almost exactly like the '=' operator).

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

This is the most universal search. It will find records with name 'dog', 'DOGS', 'Bulldog', etc..

['name', '=ilike', 'dog')]

This will find records with name 'dog', 'DOG', 'Dog', 'DOg', DoG', 'dOG', 'doG' and 'dOg'.

They use '=ilike' in your crm/wizard example to match the email case insensitively, so that any capital letter is ignored in the search, since some mail clients allow capitol letters in email addresses, while others doesn't, I think.

 

Honestly, I have never seen or used the '=?' operator...

 

I think 'child_of' is somethink like an iterative search for child-relations:

[('parent_id', 'child_of', root_id)]

This will list all children and their children ... and so on for the root_id.

 

Regards.

36
アバター
破棄
アバター
Guillaume Pothier
最善の回答

The difference between like/ilike and =like/=ilike is that with like/ilike, Odoo automatically appends and prepends a '%' to the search string before passing it to the database. So [('name', 'like', 'dog')] is equivalent to [('name', '=like', '%dog%')]. So you could use =like if you need to find the search string at the only beginning of the column, for instance [('name', '=like', 'dog%')]

6
アバター
破棄
アバター
Audrius
最善の回答

'=?' operator makes the term TRUE if right statement is None or False otherwise behaves like '='

Reference:

openerp/osv/expression.py:1169

if right is False or right is None: 

# '=?' is a short-circuit that makes the term TRUE if right is None or False 

query = 'TRUE'

params = [] 

else: 

# '=?' behaves like '=' in other cases 

query, params = self.__leaf_to_sql( create_substitution_leaf(eleaf, (left, '=', right), model))

Sample: openerp/addons/base/tests/test_expression.py:120

user_ids = users_obj.search(cr, uid, [('name', 'like', 'test'), ('parent_id', '=?', False)]) 

self.assertEqual(set(user_ids), set([a, b1, b2]), '(x =? False) failed')

As it is shown in example, parent_id cannot be False if value doesn't exist: '=?' returns True or parent_id value

5
アバター
破棄
アバター
Prakash
最善の回答

ILIKE keyword in PostgreSQL provides case insensitive search.

Reference:-  http://solaimurugan.blogspot.in/2010/07/ilike-operator-in-postgresql.html

5
アバター
破棄
Atchuthan - Technical Consultant, Sodexis Inc
著作者

so in cases why would we use =ilike?? In CRM/wizard/crm_lead_to_opportunity.py(line no:68) ids = lead_obj.search(cr, uid, [('email_from', '=ilike', email[0]), ('state', '!=', 'done')])

Prakash

please see the link http://stackoverflow.com/questions/4752705/case-insensitive-searches-queries based on the link examples need to use 'ilike'. But in the openerp Lead example it check only single record we can also use '=' instead of 'ilike'. Example:- [('email_from', '=', email[0]), ('state', '!=', 'done')]

アバター
Gerard ONeill
最善の回答

Normal odoo 'like' (and 'ilike' for the case insensitive version) allows the use of '%' and '_' within the search parameter.  It uses the SQL 'like' under the hood, which requires '%'s to either side to create the 'contains' operator, as other answers have mentioned.

So '=like' simply does not add those '%'s to either side when converting the operator to SQL.

An easy use case is the "Starts with" search:  ['field', '=like', 'Warren%'].

And the 'Ends with' search: ['field', '=like', '%hat']

And of course the exact search for a phrase with a beginning and an end: ['field', '=ilike', 'My % bag.']

Presumably early Odoo didn't think about the 'Starts With' and 'Ends With' cases.  So 'like', while being very close to its SQL counterpart, was changed in that interpretation of 'like' as 'contains'.  Probably soon afterwards, it was easy enough to remove the 'contains' functionality by adding = to the operator.  This was probably to evoke 'exactly like'  vibes.  If they wanted to evoke a more regex vibe, they should have used '^like$', which makes use of the two anchors from POSIX/Perl(PCRE) regex syntax.  Its ironic that Odoo is built on top of a Postgres DB which supports the 'similar to' operator which is *Very* 'regex like'.

0
アバター
破棄
ディスカッションを楽しんでいますか?読むだけでなく、参加しましょう!

今すぐアカウントを作成して、限定機能を利用したり、素晴らしいコミュニティと交流しましょう!

登録
コミュニティ
  • チュートリアル
  • ドキュメンテーション
  • フォーラム
オープンソース
  • ダウンロード
  • Github
  • Runbot
  • 翻訳
サービス
  • Odoo.shホスティング
  • サポート
  • アップグレード
  • カスタム開発
  • 教育プログラム
  • 会計事務所一覧
  • パートナー一覧
  • パートナーになる
企業情報
  • 会社概要
  • ブランドアセット
  • お問い合わせ
  • 採用情報
  • イベント
  • ポッドキャスト
  • ブログ
  • お客様一覧
  • リーガル情報 • プライバシーポリシー
  • セキュリティ
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo(オドゥー)は、CRM、eコマース、会計、在庫管理、POS、プロジェクト管理など、企業のさまざまな業務を一つのシステムで管理できる、ベルギー発のオープンソースのERPソフトウェアです。

高機能で使いやすく、完全に統合されたERPとして、ユニークな価値を提供しています。

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now