0
votes

After i clicked the upgrade option from Apps for my particular module, i was logged out and can see only the database selector page now. If I select my database, It gives me

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

I think there is something wrong with my last code, But have no idea where or how do i fix this and login again .Here is the traceback,

Traceback (most recent call last):
  File "/opt/odoo/odoo/modules/registry.py", line 60, in __new__
    return cls.registries[db_name]
  File "/opt/odoo/odoo/tools/func.py", line 69, in wrapper
    return func(self, *args, **kwargs)
  File "/opt/odoo/odoo/tools/lru.py", line 44, in __getitem__
    a = self.d[obj].me
KeyError: 'bio'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/odoo/odoo/modules/registry.py", line 86, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/opt/odoo/odoo/modules/loading.py", line 424, in load_modules
    registry.setup_models(cr)
  File "/opt/odoo/odoo/modules/registry.py", line 267, in setup_models
    model._setup_fields()
  File "/opt/odoo/odoo/models.py", line 2609, in _setup_fields
    field.setup_full(self)
  File "/opt/odoo/odoo/fields.py", line 482, in setup_full
    self._setup_regular_full(model)
  File "/opt/odoo/odoo/fields.py", line 2389, in _setup_regular_full
    invf = comodel._fields[self.inverse_name]
KeyError: 'id  '
2019-06-10 06:07:46,066 3151 INFO bio werkzeug: 127.0.0.1 - - [10/Jun/2019 06:07:46] "GET /web?db=bio HTTP/1.1" 500 - 11 0.014 0.340
2019-06-10 06:07:46,073 3151 ERROR bio werkzeug: Error on request:
Traceback (most recent call last):
  File "/opt/odoo/odoo/modules/registry.py", line 60, in __new__
    return cls.registries[db_name]
  File "/opt/odoo/odoo/tools/func.py", line 69, in wrapper
    return func(self, *args, **kwargs)
  File "/opt/odoo/odoo/tools/lru.py", line 44, in __getitem__
    a = self.d[obj].me
KeyError: 'bio'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/werkzeug/serving.py", line 303, in run_wsgi
    execute(self.server.app)
  File "/usr/local/lib/python3.6/dist-packages/werkzeug/serving.py", line 291, in execute
    application_iter = app(environ, start_response)
  File "/opt/odoo/odoo/service/server.py", line 409, in app
    return self.app(e, s)
  File "/opt/odoo/odoo/service/wsgi_server.py", line 128, in application
    return application_unproxied(environ, start_response)
  File "/opt/odoo/odoo/service/wsgi_server.py", line 117, in application_unproxied
    result = odoo.http.root(environ, start_response)
  File "/opt/odoo/odoo/http.py", line 1318, in __call__
    return self.dispatch(environ, start_response)
  File "/opt/odoo/odoo/http.py", line 1291, in __call__
    return self.app(environ, start_wrapped)
  File "/usr/local/lib/python3.6/dist-packages/werkzeug/middleware/shared_data.py", line 227, in __call__
    return self.app(environ, start_response)
  File "/opt/odoo/odoo/http.py", line 1469, in dispatch
    odoo.registry(db).check_signaling()
  File "/opt/odoo/odoo/__init__.py", line 98, in registry
    return modules.registry.Registry(database_name)
  File "/opt/odoo/odoo/modules/registry.py", line 62, in __new__
    return cls.new(db_name)
  File "/opt/odoo/odoo/modules/registry.py", line 86, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/opt/odoo/odoo/modules/loading.py", line 424, in load_modules
    registry.setup_models(cr)
  File "/opt/odoo/odoo/modules/registry.py", line 267, in setup_models
    model._setup_fields()
  File "/opt/odoo/odoo/models.py", line 2609, in _setup_fields
    field.setup_full(self)
  File "/opt/odoo/odoo/fields.py", line 482, in setup_full
    self._setup_regular_full(model)
  File "/opt/odoo/odoo/fields.py", line 2389, in _setup_regular_full
    invf = comodel._fields[self.inverse_name]
KeyError: 'id  ' - - -

I am using Odoo 12 CE. How do i fix this?

EDIT Here is the mdoel in the module which i was trying to upgrade(Last change i made).

class proddetail(models.Model):
    _name = 'vendr.proddetail'

    name = models.Char(related='rel_product_template.name')
    numb = models.Char(string='No')
    area = models.Char(string='Area')
    production = models.Char(string='Production')
    prev_yr = models.Char(string='Previous Year')
    curr_yr = models.Char(string='Current Year')
1
Fixed the error after several hours of searching!. I had accidently put a whitespace in a one2many model field in another module. Strange, the error never gave a clue about that module!.p.ry
The error messages aren't helpful all the time. Welcome to Odoo programming or i bet to programming at all ;-) Could you please add the wrong code to your question (little understandable example with both models because it's a onetomany relation)? And you can answer yourself, which will help others with similar problems.CZoellner
@CZoellner. Ok i've updated the question and given what went wrong in the answer.thanks.p.ry

1 Answers

0
votes

after going through my modules a couple of hours, found that there was a single whitespace i accidently put.Removing it solved the issue!

the line with error:

samplet = fields.One2many('tests.sampletest','id ',string="Sample test details")

there is a whitespace immediately after id. The tests.sampletest is another model in the same module(not the one i was trying to update).