Odoo Help

0

Developing new module. Recordset, how to filter by given id?

By
E.M.
on 2/5/16, 7:02 PM 670 views

I am trying to do this:

env['stock.move'].search([('picking_id','==',current_stock_picking)])
-current_stock_pikcing holds a given id value (in this test is 3)-.


But I get:

Invalid leaf ('picking_id', '==', 3)", "name": "exceptions.ValueError", "arguments": ["Invalid leaf ('picking_id', '==', 3)"]}}

How should I specify the search/subset condition? Thanks
1
Axel Mendoza
On 2/5/16, 7:05 PM

Hi E.M.

You have an error in the operator '==', you should use only '=', like:

env['stock.move'].search([('picking_id','=',current_stock_picking)])

Brilliant, thanks.

E.M.
on 2/5/16, 7:10 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: 2/5/16, 7:02 PM
Seen: 670 times
Last updated: 2/5/16, 7:10 PM