跳至內容
選單
此問題已被標幟
2 回覆
30372 瀏覽次數

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.

相關帖文 回覆 瀏覽次數 活動
0
5月 25
797
1
4月 25
935
4
7月 25
4679
1
2月 24
2637
0
10月 24
3968