Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie

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.

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć

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

Powiązane posty Odpowiedzi Widoki Czynność
0
maj 25
811
1
kwi 25
942
Validation Error Rozwiązane
4
lip 25
4713
1
lut 24
2648
0
paź 24
3972