This question has been flagged
1 Reply
2097 Views

Try this., it will works
if its not work., just replay

I have solve this issue, model unknown error in odoo
1) this error is mainly caused by table constraint, error is appear in many2many field for me.,
2) table data will have 2 fKey or pkey in the table
if its possible both data will conflict in the database table
3) just ckeck, some times column does not present in the table name 

I have run this query to alter my table with contraint
" ALTER TABLE table_name DROP CONSTRAINT 
product_xxxxxxxxxxxxxx_id_fkey; "


Thank you
(KP from Tamil,India)

Avatar
Discard
Best Answer

The error message "Model: Unknown (unknown) Constraint: product_xxxxxxxxxxxx_id_fkey" is indicating that there is a foreign key constraint in your database that references a table or field that does not exist.

The specific constraint that is causing the issue is the one with the name "product_xxxxxxxxxxxx_id_fkey". The "xxxxxxxxxxxx" in the name is likely a reference to the specific model or field that is causing the issue.

One possible cause of this error is that you have a field in a model that references a non-existing model or table. This could happen if you have deleted a model or table, but not removed the corresponding field in the other model that references it.

To solve this, you need to check the fields and models that are related to the field product_xxxxxxxxxxxx_id_fkey, and make sure that they are correct. Once you have identified the specific field, you can remove it or update it to reference the correct model or table.

Another possible cause is that the field is created by a module and the module is not installed properly or the module files are deleted from the server.

You can also check the database and see if the table that is referenced by the foreign key constraint still exists or not. If not, you can try to drop the constraint from the database manually using SQL commands.

It's best to consult with an expert or developer to help you resolve this error, as modifying the database directly can lead to data loss or other issues if not done properly.

Avatar
Discard