Skip to Content
Menu
This question has been flagged
2 Replies
2604 Views

Hi, we are unable to install or uninstall any moduel on our Odoo 10 CE running on Ubuntu 16.  We get the following error.


Odoo Server Error
Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/http.py", line 642, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/odoo/odoo-server/odoo/http.py", line 684, in dispatch
    result = self._call_function(**self.params)
  File "/odoo/odoo-server/odoo/http.py", line 334, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/odoo/odoo-server/odoo/service/model.py", line 101, in wrapper
    return f(dbname, *args, **kwargs)
  File "/odoo/odoo-server/odoo/http.py", line 327, in checked_call
    result = self.endpoint(*a, **kw)
  File "/odoo/odoo-server/odoo/http.py", line 942, in __call__
    return self.method(*args, **kw)
  File "/odoo/odoo-server/odoo/http.py", line 507, in response_wrap
    response = f(*args, **kw)
  File "/odoo/odoo-server/addons/web/controllers/main.py", line 899, in call_button
    action = self._call_kw(model, method, args, {})
  File "/odoo/odoo-server/addons/web/controllers/main.py", line 887, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/odoo/odoo-server/odoo/api.py", line 689, in call_kw
    return call_kw_multi(method, model, args, kwargs)
  File "/odoo/odoo-server/odoo/api.py", line 680, in call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/odoo/odoo-server/odoo/addons/base/module/module.py", line 413, in button_immediate_install
    return self._button_immediate_function(type(self).button_install)
  File "/odoo/odoo-server/odoo/addons/base/module/module.py", line 495, in _button_immediate_function
    modules.registry.Registry.new(self._cr.dbname, update_module=True)
  File "/odoo/odoo-server/odoo/modules/registry.py", line 83, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/odoo/odoo-server/odoo/modules/loading.py", line 323, in load_modules
    registry.setup_models(cr, partial=True)
  File "/odoo/odoo-server/odoo/modules/registry.py", line 303, in setup_models
    model._setup_complete()
  File "/odoo/odoo-server/odoo/models.py", line 2899, in _setup_complete
    field.setup_triggers(self)
  File "/odoo/odoo-server/odoo/fields.py", line 763, in setup_triggers
    for model, field, path in self.resolve_deps(model):
  File "/odoo/odoo-server/odoo/fields.py", line 757, in resolve_deps
    result += field.resolve_deps(model, path, seen)
  File "/odoo/odoo-server/odoo/fields.py", line 737, in resolve_deps
    field = model._fields[fname]
KeyError: u'credit



We kindly request for any ideas on how to solve this.


Regards,

Austin

Avatar
Discard
Author Best Answer

Thank You  BillNye !

It actually worked.  On Ubuntu terminal, cd to /odoo/odoo-server  .  Then run the command  ./odoo-bin -u all -ddatabasename

Everything works perfectly now.  

Thank you again.


Avatar
Discard
Best Answer

I have never had this error but I've had similar errors. Try restarting the service with the '-u all -d database_name' so all of your models and views are reloaded.

I run mine in docker and my command is

command: odoo -u all -d demo.mydomain.com

Avatar
Discard
Author

Hi BillNye,
Thank you for the reply. should it be sudo systemctl restart odoo-server -u all -d database_name ?

Also, if i were to duplicate the database and restart the service so that models and views are reloaded, will the original database be affected?

Regards

No. Just edit your docker-compose like this-
With the assumption you’re using the image odoo:10 then make it look like this

image: odoo:10
command: odoo -u all -d databasename

…and then “docker-compose up -d”

You’re just overriding the entry point command by doing this. You’re not editing the odoo.service

You can’t really break your database by doing this but you can copy the database directory somewhere else if you want to be safe