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

Hi,

I am using odoo external api trying to retrieve the last partners created or modified in the web interface, but I notice that the "write_date" field is always changing.

In some forum I read that this field is only available in the Web interface. Is this correct? Is there any way to achieve my goal?

Here is my code:


data=models.execute_kw(db, uid, password,

'res.partner', 'search_read',

[[['write_date', '>', '2020-09-05 22:00:00']]],

{'fields': ['name', 'write_date', 'comment'], 'limit': 5})


When I run it, I receive all contacts instead of those updated after September 5.



Thanks in advance

อวตาร
ละทิ้ง

All contacts in the sense, u are receiving the one which is created after the given date rite?

ผู้เขียน

Hi Rinoy,

On the website, there is only one contact modified on September 5. When I consume the API it returns this list:

[
{
"id": 14,
"name": "Azure Interior",
"write_date": "2021-09-06 19:55:30"
},
{
"id": 26,
"name": "Brandon Freeman",
"write_date": "2021-09-06 20:03:20"
},
{
"id": 33,
"name": "Colleen Diaz",
"write_date": "2021-09-06 19:55:30"
},
{
"id": 27,
"name": "Nicole Ford",
"write_date": "2021-09-06 19:55:30"
},
{
"id": 51,
"name": "Bloem GmbH",
"write_date": "2021-09-06 19:55:30"
}
]

I do not understand why the rest of the contacts appear as modified on september/6.

ผู้เขียน คำตอบที่ดีที่สุด

Hi,

On website, only one partner (Azure Interior) appears as updated on September/5:

Azure Interior
Services
Fremont, Estados Unidos
05/09/2021 22:45:50

Azure Interior
Azure Interior, Brandon Freeman
Creative Director en Azure Interior
Fremont, Estados Unidos
03/09/2021 04:00:05

Azure Interior
Azure Interior, Colleen Diaz
Business Executive en Azure Interior
Fremont, Estados Unidos
03/09/2021 04:00:05






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

I think the result is correct,
res. partner is a core model with lots of fields so any field value change/write it updates the write date 
fields like  supplier_rank, customer_rank, im_status are change very frequently

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ค. 22
4909
0
ธ.ค. 21
35
1
มี.ค. 17
3115
5
มิ.ย. 15
10711
0
มี.ค. 15
3592