title: Iam trying to install a new module in odoo but error occuring, AttributeError: 'str' object has no attribute 'setdefault'
body: <p>I am trying to use the ODOO server, however I am getting this exception. Seems like a configuraton issue:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/odoo/http.py&quot;, line 640, in _handle_exception
      return super(JsonRequest, self)._handle_exception(exception)
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/odoo/http.py&quot;, line 316, in _handle_exception
      raise exception.with_traceback(None) from new_cause
  **AttributeError: 'str' object has no attribute 'setdefault'**
  </code></pre>
  <p>Odoo Server Error</p>
  <pre><code>Traceback (most recent call last):
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/odoo/addons/base/models/ir_http.py&quot;, line 237, in _dispatch
      result = request.dispatch()
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/odoo/http.py&quot;, line 684, in dispatch
      result = self._call_function(**self.params)
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/odoo/http.py&quot;, line 360, in _call_function
      return checked_call(self.db, *args, **kwargs)
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/odoo/service/model.py&quot;, line 94, in wrapper
      return f(dbname, *args, **kwargs)
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/odoo/http.py&quot;, line 348, in checked_call
      result = self.endpoint(*a, **kw)
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/odoo/http.py&quot;, line 913, in __call__
      return self.method(*args, **kw)
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/odoo/http.py&quot;, line 532, in response_wrap
      response = f(*args, **kw)
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/addons/web/controllers/main.py&quot;, line 1368, in call_button
      action = self._call_kw(model, method, args, kwargs)
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/addons/web/controllers/main.py&quot;, line 1356, in _call_kw
      return call_kw(request.env[model], method, args, kwargs)
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/odoo/api.py&quot;, line 396, in call_kw
      result = _call_kw_multi(method, model, args, kwargs)
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/odoo/api.py&quot;, line 383, in _call_kw_multi
      result = method(recs, *args, **kwargs)
    File &quot;&lt;decorator-gen-71&gt;&quot;, line 2, in button_immediate_install
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/odoo/addons/base/models/ir_module.py&quot;, line 73, in check_and_log
      return method(self, *args, **kwargs)
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/odoo/addons/base/models/ir_module.py&quot;, line 474, in button_immediate_install
      return self._button_immediate_function(type(self).button_install)
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/odoo/addons/base/models/ir_module.py&quot;, line 592, in _button_immediate_function
      modules.registry.Registry.new(self._cr.dbname, update_module=True)
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/odoo/modules/registry.py&quot;, line 89, in new
      odoo.modules.load_modules(registry._db, force_demo, status, update_module)
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/odoo/modules/loading.py&quot;, line 453, in load_modules
      processed_modules += load_marked_modules(cr, graph,
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/odoo/modules/loading.py&quot;, line 346, in load_marked_modules
      loaded, processed = load_module_graph(
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/odoo/modules/loading.py&quot;, line 197, in load_module_graph
      registry.setup_models(cr)
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/odoo/modules/registry.py&quot;, line 269, in setup_models
      model._setup_base()
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/odoo/models.py&quot;, line 2780, in _setup_base
      self._add_field(name, field.new())
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/odoo/models.py&quot;, line 402, in _add_field
      field.setup_base(self, name)
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/odoo/fields.py&quot;, line 278, in setup_base
      self._setup_attrs(model, name)
    File &quot;/home/ajay/PycharmProjects/odoo/odoo-14.0/odoo/fields.py&quot;, line 2282, in _setup_attrs
      ondelete.setdefault(key, 'set null')
  Exception
  </code></pre>
  <p>The above exception was the direct cause of the following exception:</p>