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

Get all values from context key

By
Eric
on 1/10/14, 4:54 PM 1,023 views

Hello,

One of my context keys contains multiple ids that I am going to use in a python method. What I am trying to do is get each of those ids from the context key, into an array so I can use it in my method. So far this is what I am doing:

ids = context.get('list_of_ids')

Now the value that is being returned to ids is this: [[6, False, [3, 13481]]]

I dont know why the 6, and the False are there, but the 3, and the 13481 are the ids I want to get into the ids variable. Does anyone know how I can get just the 3, and the 13481 ids?

ids = context.get('list_of_ids')[0][2]

GH Mediacloud, Grover Menacho
on 1/10/14, 5:41 PM

6 it's because you are pulling a one2many or many2many. I'm not sure.. So this has some additional codes.

GH Mediacloud, Grover Menacho
on 1/10/14, 5:42 PM

Thank you Grover. Your answer is greatly appreciated

Eric
on 1/10/14, 5:44 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

0 follower(s)

Stats

Asked: 1/10/14, 4:54 PM
Seen: 1023 times
Last updated: 3/16/15, 8:10 AM