跳至內容
選單
此問題已被標幟
3067 瀏覽次數

Hi everyone

I have function search :

when _cat=22011 :

 for _cat in _catstring:
            if _cat in ['W','H']:
                continue
            if len(_cat)<=3:
                continue
            _query_catstring_oj=self.pool.get('product.category')
            _query_catstring_ids=_query_catstring_oj.search(cr,uid,[('name', '=' ,_cat)])
            ...........

results is null But I edit

   _query_catstring_ids=_query_catstring_oj.search(cr,uid,[('name', '=' ,_cat)])

by

 _query_catstring_ids=_query_catstring_oj.search(cr,uid,[('name', '=' ,'2011')])

result is list object

can you help me ? thanks hungnt

頭像
捨棄

Search method always return list of Ids. Make sure domain is correct what you are searching for.

相關帖文 回覆 瀏覽次數 活動
4
1月 24
14022
1
3月 15
6816
2
12月 23
18599
3
6月 24
3675
2
7月 21
7134