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

Hi everyone, 

I am new here and working on the task which I am adding customer data to Odoo res.partner model through python using API. 

My question is: Is there any ways or tip that I can use to get the last update date, max_id or something like this? 

My data will be continuously added and I do not want duplicate records. So, I want to have one parameter which I can use to get the last added customer and start to create/update customers from that time on.

So if the same customer is existing: update the data

If not: create a new one


อวตาร
ละทิ้ง

Odoo have create_date, write_date

create_date --> while create the record the date time will update

write_date --> While any change happened it will update that date time

Are you using xmlrpc call or Rest API?

ผู้เขียน

@subbarao I am using external API

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

@shalin wilson what is the difference between last_updated and write_date?

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

__last_update field is there in res.partner and its automatically  updates 
is it enough for you to check the DateTime??

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

If Odoo create record with external API with success, returns its ID. See External API documentation.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ต.ค. 20
4242
3
ก.ค. 23
2714
OdooV13 Update a record แก้ไขแล้ว
1
พ.ย. 20
10776
2
มิ.ย. 18
3831
0
พ.ค. 15
3999