Daniel Díaz
Daniel Díaz

Reputation: 226

Get list of ids - Odoo

I want get a list of ids in odoo 9...

No working because expected a singleton

order_recs = order_obj.search([('date_order','<=',previous_start_date),('date_order','>=',previous_new_rec_date)]).id

order_line_recs = order_line_obj.search([('order_id','in',order_recs)])

I expected order_line_recs with a list o order_line

Upvotes: 2

Views: 1743

Answers (1)

Instead of the id attribute, you should use ids. Example:

order_recs = order_obj.search([('date_order','<=',previous_start_date),('date_order','>=',previous_new_rec_date)]).ids

Which will return the list of ids from the RecordSet.

Upvotes: 3

Related Questions