This question has been flagged
2 Replies
5393 Views

Hi Community!

I'm currently customizing reinstalling my Odoo database as I've been getting a recursion error on my previous database. I requested a reinstall of Odoo from my VPS provider. After reinstallation of the VPS, I installed a backup of my database. Everything seemed ok but then now I cannot install any app or module as it's giving me an error everytime I try to install any app or module. I'm a total beginner in setting up Odoo but everything seems to be straight forward so I think I can follow your suggestions if instructed. 

Here's the error log of the problem I encountered. I appreciate any help from you guys. Thank you very much!

Error: 
Odoo Server Error

Traceback (most recent call last):
File "/opt/odoo12/odoo/odoo/http.py", line 656, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo12/odoo/odoo/http.py", line 314, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/opt/odoo12/odoo/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/opt/odoo12/odoo/odoo/http.py", line 698, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo12/odoo/odoo/http.py", line 346, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo12/odoo/odoo/service/model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo12/odoo/odoo/http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo12/odoo/odoo/http.py", line 941, in __call__
return self.method(*args, **kw)
File "/opt/odoo12/odoo/odoo/http.py", line 519, in response_wrap
response = f(*args, **kw)
File "/opt/odoo12/odoo/addons/web/controllers/main.py", line 966, in call_button
action = self._call_kw(model, method, args, {})
File "/opt/odoo12/odoo/addons/web/controllers/main.py", line 954, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo12/odoo/odoo/api.py", line 759, in call_kw
return _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo12/odoo/odoo/api.py", line 746, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-61>", line 2, in button_immediate_install
File "/opt/odoo12/odoo/odoo/addons/base/models/ir_module.py", line 74, in check_and_log
return method(self, *args, **kwargs)
File "/opt/odoo12/odoo/odoo/addons/base/models/ir_module.py", line 445, in button_immediate_install
return self._button_immediate_function(type(self).button_install)
File "/opt/odoo12/odoo/odoo/addons/base/models/ir_module.py", line 561, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/opt/odoo12/odoo/odoo/modules/registry.py", line 86, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/opt/odoo12/odoo/odoo/modules/loading.py", line 421, in load_modules
loaded_modules, update_module, models_to_check)
File "/opt/odoo12/odoo/odoo/modules/loading.py", line 313, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/opt/odoo12/odoo/odoo/modules/loading.py", line 195, in load_module_graph
registry.init_models(cr, model_names, {'module': package.name})
File "/opt/odoo12/odoo/odoo/modules/registry.py", line 301, in init_models
func()
File "/opt/odoo12/odoo/odoo/models.py", line 282, in _reflect
self.env['ir.model.fields']._reflect_model(self)
File "/opt/odoo12/odoo/odoo/addons/base/models/ir_model.py", line 879, in _reflect_model
for name in to_xmlids
File "/opt/odoo12/odoo/odoo/addons/base/models/ir_model.py", line 1539, in _update_xmlids
self.env.cr.execute(query, [arg for row in sub_rows for arg in row])
File "/opt/odoo12/odoo/odoo/sql_db.py", line 148, in wrapper
return f(self, *args, **kwargs)
File "/opt/odoo12/odoo/odoo/sql_db.py", line 225, in execute
res = self._obj.execute(query, params)
psycopg2.ProgrammingError: there is no unique or exclusion constraint matching the ON CONFLICT specification

Avatar
Discard
Best Answer

Please check in the database tables if it does have primary key or not.

One of my client had such issue while installing/updating any app and I found that primary key constraint was deleted by someone. 

Avatar
Discard
Author

Thank you! May I know how I can check that?