Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
8877 Lượt xem

I build a page following this https://www.odoo.com/documentation/9.0/api_integration.html

$models->execute_kw($db, $uid, $password, 
    'product.product', 'search_read',
    array(array(array('supplier_id', '=', 13))),
    array('fields'=>array('name','supplier_id')));

but the filter does not filter my results, i obtain something like :

{
    ["id"]=> int(81)
    ["supplier_id"]=>       array(2) {
          [0]=> int(25)
          [1]=> string(11) "a supplier name"
    }
    ["name"]=> string(32) "a product name"
}

How must I set the filter to obtain only this products from a supplier with a specific int ou a specific name ?

Thanks for help

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

need I change the model name ?
The relation is Many2Many, how to filter with this type of relation ? 
 

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 12 17
7704
2
thg 12 23
20153
0
thg 8 25
157
1
thg 8 25
497
2
thg 7 25
2956