تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
30377 أدوات العرض

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
مايو 25
798
1
أبريل 25
935
Validation Error تم الحل
4
يوليو 25
4682
1
فبراير 24
2637
0
أكتوبر 24
3969