Odoo Help


how to convert char results into index (result index)

Lakay lakay
on 9/25/14, 12:08 AM 815 views

Hi, im having a problem in here:



                for record in partnerid:



the return value of partnerid when i print it on a text box in the odoo is " (3, u'Administrator') "  the 3 there is the partner id im looking for, how can i cast the result into an address location   i want some like this (output)    ->>  [3]  because i will use this on later codes




Here "partner_id" is the many2one field so, it is read the data like "(3,u'Administrator')". If you just want the 3 from this just partner ID then you have to write like below.

                 for record in partnerid:

Here record['partner_id'][0] will return the 3.

thank you chirag! it works perfectly.

Lakay lakay
on 9/25/14, 1:31 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.


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

1 follower(s)


Asked: 9/25/14, 12:08 AM
Seen: 815 times
Last updated: 3/16/15, 8:10 AM