Odoo Help

Welcome!

This community 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.

0

search in openerp v7 error

By
lam a bao
on 11/26/13, 6:13 AM 687 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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

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