Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
5603 มุมมอง

Hi all !

Following this example :

ids = models.execute_kw(db, uid, password,
    'res.partner', 'search',
    [[['is_company', '=', True]]],
    {'limit': 1})
[record] = models.execute_kw(db, uid, password,
    'res.partner', 'read', [ids])
# count the number of fields fetched by default
len(record)
I'm trying to find a way to get all the ids of the products i have in my database, but i don't knowhow to write the "search" as the field "is_product" doesn't exist and in which model as it won't be in "res.partner" for sure.

If anyone can help :)


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

1. Change res.partner to product.template. 

2. Change domain [[['is_company', '=', True]]] to [[]].

3. Remove limit

The code should look like as follows:

ids = models.execute_kw(db, uid, password,'product.template', 'search', [[]]) 
print(ids)



อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

I finally ended up with a solution that you can see here :

https://stackoverflow.com/questions/70392603/how-to-get-good-source-code-in-odoo-to-be-able-to-use-with-selenium/70408473#70408473


As usual copy/paste link ! 

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ต.ค. 20
5353
0
มี.ค. 20
20072
0
มี.ค. 15
4115
0
ม.ค. 23
2291
0
ต.ค. 22
7686