This question has been flagged
2 Replies
8992 Views

ODOO 12

Error: 
Odoo Server Error

Traceback (most recent call last):
File "/opt/odoo/odoo/odoo/api.py", line 1039, in get
value = self._data[key][field][record._ids[0]]
KeyError: 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/odoo/odoo/odoo/fields.py", line 980, in __get__
value = record.env.cache.get(record, self)
File "/opt/odoo/odoo/odoo/api.py", line 1041, in get
raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ('pos.config(1,).last_session_closing_date', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/odoo/odoo/odoo/http.py", line 654, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo/odoo/http.py", line 312, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/opt/odoo/odoo/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/opt/odoo/odoo/odoo/http.py", line 696, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo/odoo/http.py", line 344, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo/odoo/service/model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo/odoo/http.py", line 337, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo/odoo/odoo/http.py", line 939, in __call__
return self.method(*args, **kw)
File "/opt/odoo/odoo/odoo/http.py", line 517, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 904, in search_read
return self.do_search_read(model, fields, offset, limit, domain, sort)
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 926, in do_search_read
offset=offset or 0, limit=limit or False, order=sort or False)
File "/opt/odoo/odoo/odoo/models.py", line 4570, in search_read
result = records.read(fields)
File "/opt/odoo/odoo/odoo/models.py", line 2787, in read
vals[name] = convert(record[name], record, use_name_get)
File "/opt/odoo/odoo/odoo/models.py", line 5098, in __getitem__
return self._fields[key].__get__(self, type(self))
File "/opt/odoo/odoo/odoo/fields.py", line 984, in __get__
self.determine_value(record)
File "/opt/odoo/odoo/odoo/fields.py", line 1095, in determine_value
self.compute_value(recs)
File "/opt/odoo/odoo/odoo/fields.py", line 1051, in compute_value
self._compute_value(records)
File "/opt/odoo/odoo/odoo/fields.py", line 1042, in _compute_value
getattr(records, self.compute)()
File "/opt/odoo/odoo/addons/point_of_sale/models/pos_config.py", line 199, in _compute_last_session
pos_config.last_session_closing_date = session[0]['stop_at'].date()
AttributeError: 'bool' object has no attribute 'date'

Avatar
Discard
Author Best Answer

The problem was a field that did not have the date recorded as a session closure.

Modify that field manually and fill in any date, and it worked.

Thank you very much, case solved

Avatar
Discard

On this forum, to say thankyou you need to mark the answer and upvote it.

Best Answer

What did you do ? without explaining what you have done before the error came up, it is hard to help.

There is a date problem (see the 2 last lines). Chek  your POS sessions, the last probably miss a date.

Avatar
Discard