Odoo Help

0

search in openerp v7 error

By
lam a bao
on 11/26/13, 6:13 AM 990 views

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.

Anil R. Kesariya
on 11/26/13, 7:38 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

Asked: 11/26/13, 6:13 AM
Seen: 990 times
Last updated: 3/16/15, 8:10 AM