Odoo Help

0

How to get some data from database using API?

By
Dr Obx
on 3/3/16, 10:05 AM 508 views

Here is my question:

find location where product_id = some_id and id is not 7 ?

the method below won't work

location = self.env['stock.quant'].search([('product_id','=',product_id.id),('location_id','!=',7)])

How should I do it ?

Thanx in advance ;)

Use the SQL API!! :)

Bista Solutions US, Ray Carnes
on 3/3/16, 10:56 AM

Agree, but I would like to use Odoo API before I'll use SQL if possible of course :)

Dr Obx
on 3/3/16, 10:57 AM
0
Thanh Loyal
On 3/4/16, 2:04 AM

In search() method, the domain should be [[...]] and not [(...)]

in field declaration and xml the usage is reversed.

0
Samer Al-Sarhan
On 3/3/16, 6:10 PM

I see the problem in the domain, use it like this [('product_id.id','=',product_id.id).....

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: 3/3/16, 10:05 AM
Seen: 508 times
Last updated: 3/4/16, 2:04 AM