Odoo Help

0

what value will return this code [folio.order_id.id for folio in self.browse(cr, uid, ids)] ?

By
Odoo
on 12/17/14, 12:58 AM 616 views

def button_dummy(self, cr, uid, ids, context=None):
        order_ids = [folio.order_id.id for folio in self.browse(cr, uid, ids)]
        print ("order_ids$$$$$$$$$$$$$$$$$$                        ",order_ids)
        return self.pool.get('sale.order').button_dummy(cr, uid, order_ids, context={})

1

@Libu

order_ids = [folio.order_id.id for folio in self.browse(cr, uid, ids)]

This returns an list of ids which are of "sale.order", the list of numeric ids.

This is a List Comprehension

hope this helps !!.

Thanks Emipro for Replay...

Odoo
on 12/17/14, 7:30 AM
1
Ivan
On 12/17/14, 1:26 AM

It is always good to learn about Python's list comprehension: http://www.pythonforbeginners.com/basics/list-comprehensions-in-python

Thanks Ivan

Odoo
on 12/17/14, 7:30 AM

Pleasure to help.

Ivan
on 12/17/14, 10:45 PM

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.

Register

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)

Stats

Asked: 12/17/14, 12:58 AM
Seen: 616 times
Last updated: 3/16/15, 8:10 AM