Hello everyone,
I am unable to save an already existing product, after pressing ‹ Save › button ‹ Unique constraint violation › error is shown:
I have checked the database manually and there are no duplicate Product entries with same code in ‹ base_product › table.
I’ve tried removing the constraint using following SQL:
alter table base_product drop constraint uk_kmoa50rib71d6kh82rgrd9rpb;
After removing constraint pressing ‹ Save › button worked. After checking the database I found duplicate entries for Product:
select id, dtype, code, name from base_product where code = 'ABCD';
id | dtype | code | name
-----+----------------+------+----------
17 | Product | ABCD | Alphabet
114 | ProductCompany | ABCD |
(2 rows)
Products are very simillar, main difference is ‹ dtype › column, a duplicated product was added with dtype = ‹ ProductCompany › while original Product (the product ‹ Save › button was pressed on) has dtype = ‹ Product ›.
NOTE: Saving of a products were working correctly, but it broke. Unfortunately I am unable to trace what caused this. This has happened few times before and was fixed by restoring the entire linux VM from a backup.
Please advise.
Postgres version: 12
Axelor-open-suite version: 6.3.3