I've got the Odoo 12 CE and when I try to uninstall any module I get the following error:
Error:
Odoo Server Error
Traceback (most recent call last):
File "/opt/odoo/odoo/odoo/models.py", line 4689, in ensure_one
_id, = self._ids
ValueError: too many values to unpack (expected 1)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/odoo/odoo/odoo/http.py", line 654, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo/odoo/http.py", line 312, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/opt/odoo/odoo/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/opt/odoo/odoo/odoo/http.py", line 696, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo/odoo/http.py", line 344, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo/odoo/service/model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo/odoo/http.py", line 337, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo/odoo/odoo/http.py", line 939, in __call__
return self.method(*args, **kw)
File "/opt/odoo/odoo/odoo/http.py", line 517, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 966, in call_button
action = self._call_kw(model, method, args, {})
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 954, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo/odoo/odoo/api.py", line 749, in call_kw
return _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo/odoo/odoo/api.py", line 736, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/opt/odoo/odoo/odoo/addons/base/wizard/base_module_uninstall.py", line 60, in action_uninstall
return modules.button_immediate_uninstall()
File "</usr/local/lib/python3.6/dist-packages/decorator.py:decorator-gen-64>", line 2, in button_immediate_uninstall
File "/opt/odoo/odoo/odoo/addons/base/models/ir_module.py", line 73, in check_and_log
return method(self, *args, **kwargs)
File "/opt/odoo/odoo/odoo/addons/base/models/ir_module.py", line 578, in button_immediate_uninstall
return self._button_immediate_function(type(self).button_uninstall)
File "/opt/odoo/odoo/odoo/addons/base/models/ir_module.py", line 553, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/opt/odoo/odoo/odoo/modules/registry.py", line 86, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/opt/odoo/odoo/odoo/modules/loading.py", line 476, in load_modules
Module.browse(modules_to_remove.values()).module_uninstall()
File "</usr/local/lib/python3.6/dist-packages/decorator.py:decorator-gen-63>", line 2, in module_uninstall
File "/opt/odoo/odoo/odoo/addons/base/models/ir_module.py", line 73, in check_and_log
return method(self, *args, **kwargs)
File "/opt/odoo/odoo/odoo/addons/base/models/ir_module.py", line 460, in module_uninstall
self._remove_copied_views()
File "/opt/odoo/odoo/odoo/addons/base/models/ir_module.py", line 478, in _remove_copied_views
orphans.unlink()
File "/opt/odoo/odoo/addons/website/models/ir_ui_view.py", line 162, in unlink
self += self._get_specific_views()
File "/opt/odoo/odoo/addons/website/models/ir_ui_view.py", line 102, in _get_specific_views
self.ensure_one()
File "/opt/odoo/odoo/odoo/models.py", line 4692, in ensure_one
raise ValueError("Expected singleton: %s" % self)
ValueError: Expected singleton: ir.ui.view(1465, 1466, 1463, 1464, 1475, 1477, 1476, 1461, 1473, 1462, 1478, 1474)
No matter what module I try to uninstall I get this similar error.
Does anyone know how to fix this issue?
It looks very familiar to a bug that was recently in Odoo 12. It resulted in errors when uninstalling website much like your traceback. Can you try updating your Odoo source code then updating the website module en then uninstalling it?
I got this error when trying to uninstall the live chat and blog modules. I just got the same (or very similar) error when trying to change (install) to default website theme. They all depend on the website module, right?
Do you still think that I should try to update the odoo source code? I've installed from github. It is a fresh installation.
Convert your answer to a comment to keep this question clean. No then you probably have another issue. Do you have custom modules that change logic on the ir.ui.view views or something?
No, I don't have any custom module.
I've installed the Odoo 12 from GitHub on Ubuntu Server 12.04.
I have made very little tweaks yet. I've just installed website module and then added some apps to the website. Then I changed my mind, and when I tried to uninstall live chat support and blog I got that error.
I meant Ubuntu Server 18.04, sorry.
And I now remember that I got this error very early - right after installing the website module.
It happen when it promped me to choose which website theme I wanted: I selected default and got that error, so I had to select bootswatch.
I managed to install some apps on website and then, like I've mentioned, the error happened again when I tried to uninstall them.