İçereği Atla
Menü
Bu soru işaretlendi
3 Cevaplar
18297 Görünümler

Hello all,

In the new API, the search() method returns a recordset. For example, this code :

ids = self.search([('default_code', operator, name)])

COuld return something like this :

ids = product.product(1366, 1365, 1325, 1303, 1297, 1296, 1295, 1291)


How could I obtains a list of IDs like this instead????

ids = [1366, 1365, 1325, 1303, 1297, 1296, 1295, 1291]


Thanks


Avatar
Vazgeç
Üretici En İyi Yanıt

I have found how to get an ids list.

Just use :

ids.ids

to get :

[1366, 1365, 1325, 1303, 1297, 1296, 1295, 1291]

Avatar
Vazgeç
Üretici

Probably that products.ids would be a better name for my variable instead of ids.ids...

En İyi Yanıt

Hi Pascal,

You can also use like,

ids = self.search([('default_code', operator, name)]).ids


Regards,

Anil.

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
4
Eyl 20
41881
New Odoo api Çözüldü
1
Mar 15
3621
1
Şub 16
4004
0
Eki 22
3231
0
Mar 15
5302