1
votes

When trying to validate or submit a new EXPENSE in odoo version 10.0, i get the following Error.

This thread is expressed in Odoo Forum

Traceback (most recent call last):
  File "/home/gloxon/odoo/http.py", line 642, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/gloxon/odoo/http.py", line 684, in dispatch
    result = self._call_function(**self.params)
  File "/home/gloxon/odoo/http.py", line 334, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/gloxon/odoo/service/model.py", line 101, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/gloxon/odoo/http.py", line 327, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/gloxon/odoo/http.py", line 942, in __call__
    return self.method(*args, **kw)
  File "/home/gloxon/odoo/http.py", line 507, in response_wrap
    response = f(*args, **kw)
  File "/home/gloxon/addons/web/controllers/main.py", line 892, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/gloxon/addons/web/controllers/main.py", line 884, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/gloxon/odoo/api.py", line 687, in call_kw
    return call_kw_model(method, model, args, kwargs)
  File "/home/gloxon/odoo/api.py", line 672, in call_kw_model
    result = method(recs, *args, **kwargs)
  File "/home/gloxon/addons/mail/models/mail_thread.py", line 228, in create
    thread = super(MailThread, self).create(values)
  File "/home/gloxon/odoo/models.py", line 3847, in create
    record = self.browse(self._create(old_vals))
  File "/home/gloxon/odoo/models.py", line 3942, in _create
    cr.execute(query, tuple(u[2] for u in updates if len(u) > 2))
  File "/home/gloxon/odoo/sql_db.py", line 154, in wrapper
    return f(self, *args, **kwargs)
  File "/home/gloxon/odoo/sql_db.py", line 231, in execute
    res = self._obj.execute(query, params)
ProgrammingError: relation "hr_expense_id_seq" does not exist
LINE 1: ...uid", "create_date", "write_date") VALUES(nextval('hr_expens...

I don't know what to do in other to fix this.

1
Try to reinstall/update app hr_expense. Very weird that there is no sequence for primary key id on hr_expense table.CZoellner
REINSTALLING works but causes lost of existing data. while UPDATE does not work.demerit

1 Answers

0
votes

I had a similar case of a missing sequence with Odoo 12 CE. It turned out that I was restoring a database dump from Postgres 10.10 into a Postgres 9.6 and they don't like each other.

The solution was to install Postgres 10.10, restore the database there and restart Odoo.