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

orm function search other tables

By
Lakay lakay
on 9/18/14, 4:59 AM 731 views

using orm function search how do i search for the field in the other tables. (for example) table res.partner  and field create_id 

   def btnSet(self,cr,uid,ids,values,context=None):            

                search1=self.search(cr,uid,[('create_id','=',1)])             #IS THIS CORRECT? this is just example
                if search1:
                        for id in search1:
                                self.write(cr,uid,[id],{'current':False})
                


                return True

 

what i mean is that how will this code know that you are referring to res.partner table?

 

 

 

 

 

 

0
Andreas Stauder
On 9/18/14, 5:35 AM

self.pool.get('res.partner').search(cr, uid, [('create_id','=',1)], context=context)

thanks andreas its working!

Lakay lakay
on 9/22/14, 10:34 PM

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

1 follower(s)

Stats

Asked: 9/18/14, 4:59 AM
Seen: 731 times
Last updated: 3/16/15, 8:10 AM