I select field in database using sql command
partner_obj = self.pool.get('res.partner'). browse (cr, uid, ids, *args)
partner_name = partner_obj.ids
customer = (partner_name)
cr.execute("select b.city from res_partner a, res_partner_address b where b.partner_id = a.id AND a.id = %s",(customer))
ads = cr.fetchone()
city = ads and ads[0] or None
but, I just know we must convert into string. I already try to make like this (the code above), but still doesn’t work.
I made like this, because you want to know SO is in a message in which the city
may you help me, please
thank you
I don’t think you need to run raw SQL, you should be able to use the browse records to get the information you want. I wasn’t sure exactly what you wanted from your question, but I’ll assume that you are passing in a list of partner ids, and you want back a list of all the city names that they have addresses in. I have not tested this code, it’s just a suggestion.