I have installed "Sales Management" on my Odoo v11 community edition. Everything was working fine until a few days ago. Now whenever I click on the "sales" tab, I get this server error:
Error:
Odoo Server Error
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/tools/cache.py", line 84, in lookup
r = d[key]
File "/usr/lib/python3/dist-packages/odoo/tools/func.py", line 68, in wrapper
return func(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/tools/lru.py", line 44, in __getitem__
a = self.d[obj].me
KeyError: ('ir.actions.actions', <function IrActions.get_bindings at 0x7efe15cfc0d0>, frozenset({1, 3, 4, 38, 39, 8, 7, 12, 13, 14, 47, 48, 22, 23, 25, 30}), 'sale.order')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 940, in __get__
value = record.env.cache.get(record, self)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 967, in get
value = self._data[key][field][record._ids[0]]
KeyError: 291
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/http.py", line 651, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 310, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/usr/lib/python3/dist-packages/odoo/http.py", line 693, in dispatch
result = self._call_function(**self.params)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 342, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 335, in checked_call
result = self.endpoint(*a, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 937, in __call__
return self.method(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 515, in response_wrap
response = f(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 934, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 926, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 687, in call_kw
return call_kw_model(method, model, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 672, in call_kw_model
result = method(recs, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/models.py", line 1297, in load_views
for [v_id, v_type] in views
File "/usr/lib/python3/dist-packages/odoo/models.py", line 1297, in <dictcomp>
for [v_id, v_type] in views
File "/usr/lib/python3/dist-packages/odoo/addons/mail/models/mail_thread.py", line 374, in fields_view_get
res = super(MailThread, self).fields_view_get(view_id=view_id, view_type=view_type, toolbar=toolbar, submenu=submenu)
File "/usr/lib/python3/dist-packages/odoo/models.py", line 1389, in fields_view_get
bindings = self.env['ir.actions.actions'].get_bindings(self._name)
File "<decorator-gen-27>", line 2, in get_bindings
File "/usr/lib/python3/dist-packages/odoo/tools/cache.py", line 89, in lookup
value = d[key] = self.method(*args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_actions.py", line 120, in get_bindings
result[binding_type].append(action.read()[0])
File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_actions.py", line 207, in read
result = super(IrActionsActWindow, self).read(fields, load=load)
File "/usr/lib/python3/dist-packages/odoo/models.py", line 2609, in read
vals[name] = convert(record[name], record, use_name_get)
File "/usr/lib/python3/dist-packages/odoo/models.py", line 4786, in __getitem__
return self._fields[key].__get__(self, type(self))
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 944, in __get__
self.determine_value(record)
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 1055, in determine_value
self.compute_value(recs)
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 1011, in compute_value
self._compute_value(records)
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 1002, in _compute_value
getattr(records, self.compute)()
File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_actions.py", line 167, in _compute_search_view
fvg = self.env[act.res_model].fields_view_get(act.search_view_id.id, 'search')
File "/usr/lib/python3/dist-packages/odoo/api.py", line 761, in __getitem__
return self.registry[model_name]._browse((), self)
File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 179, in __getitem__
return self.models[model_name]
KeyError: 'sale.advance.payment.inv'
The only code change I made was adding an if-else statement in product_template to add a constraint and it was working perfectly fine along with the sales module, but now all of a sudden the sales module throws this exception. What could be causing this?