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

Hi,

Till yesterday everything was good on Odoo. But now when any of the employee in our company (or myself) save the Timesheet, we get the following errors:

duplicate key value violates unique constraint "hr_timesheet_sheet_sheet_pkey"

DETAIL: Key (id)=(91) already exists.

The id keeps changing for all employees.
I would really appreciate any help with this.
Thanks.

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

This happend to me - it turns out you need to resync your primary key fields in Postgres. The key is the SQL statement:

SELECT setval('tablename_id_seq', (SELECT MAX(id) FROM tablename)+1);

อวตาร
ละทิ้ง

Please use a readable formatting. The default is good enough.

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
พ.ค. 25
818
1
เม.ย. 25
942
Validation Error แก้ไขแล้ว
4
ก.ค. 25
4720
1
ก.พ. 24
2650
0
ต.ค. 24
3972