Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
2949 Vizualizări

hi guys 

im newbie in odoo developing , im using odoo 15 , and the ORM method not work properly 

i wanna getting product ids with search method in this way :

ids = self.env['product.product'].search([])
print('products ... ', ids)


the out put is expected like this:

products ... [1,2,3,...]

but it gives this in output instead :


products.... products.products(1,)


i don't know why this is happening , how can i solve this problem??? thank you in advanced


Imagine profil
Abandonează
Cel mai bun răspuns

Hi,

product_ids = self.env['product.product'].search([])

Above code will return record sets.

If you need to get ids add .ids along with it: 

ids = self.env['product.product'].search([]).ids

Thanks

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
aug. 23
2019
2
dec. 23
1452
3
apr. 25
7851
1
ian. 25
1035
3
nov. 19
3181