跳至内容
菜单
此问题已终结
2968 查看

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
13907
1
3月 15
6710
2
12月 23
18520
3
6月 24
3559
2
7月 21
7049