Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
29684 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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);

Ảnh đại diện
Huỷ bỏ

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 4 25
264
Validation Error Đã xử lý
5
thg 3 25
3361
1
thg 2 24
1823
0
thg 10 24
3335
0
thg 12 22
1739