Help

0

error message product template

Avatar
Enrique Torres

Hi!

I imported a product catalog file and when I try to check a product this message appears:

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: 240

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/odoo/odoo/odoo/fields.py", line 981, 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: ('product.template(240,).weight_uom_name', None)

During handling of the above exception, another exception occurred:

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: 240

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/odoo/odoo/odoo/fields.py", line 981, 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: ('product.template(240,).weight_uom_id', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/odoo/odoo/odoo/http.py", line 656, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo/odoo/odoo/http.py", line 314, 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 698, in dispatch
    result = self._call_function(**self.params)
  File "/opt/odoo/odoo/odoo/http.py", line 346, 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 339, in checked_call
    result = self.endpoint(*a, **kw)
  File "/opt/odoo/odoo/odoo/http.py", line 941, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo/odoo/odoo/http.py", line 519, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/odoo/addons/web/controllers/main.py", line 962, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/opt/odoo/odoo/addons/web/controllers/main.py", line 954, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/opt/odoo/odoo/odoo/api.py", line 749, in call_kw
    return _call_kw_multi(method, model, args, kwargs)
  File "/opt/odoo/odoo/odoo/api.py", line 736, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/opt/odoo/odoo/odoo/models.py", line 2797, in read
    vals[name] = convert(record[name], record, use_name_get)
  File "/opt/odoo/odoo/odoo/models.py", line 5123, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/opt/odoo/odoo/odoo/fields.py", line 985, in __get__
    self.determine_value(record)
  File "/opt/odoo/odoo/odoo/fields.py", line 1098, in determine_value
    self.compute_value(recs)
  File "/opt/odoo/odoo/odoo/fields.py", line 1052, in compute_value
    self._compute_value(records)
  File "/opt/odoo/odoo/odoo/fields.py", line 1045, in _compute_value
    self.compute(records)
  File "/opt/odoo/odoo/odoo/fields.py", line 609, in _compute_related
    values = [first(value[name]) for value in values]
  File "/opt/odoo/odoo/odoo/fields.py", line 609, in <listcomp>
    values = [first(value[name]) for value in values]
  File "/opt/odoo/odoo/odoo/models.py", line 5123, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/opt/odoo/odoo/odoo/fields.py", line 985, in __get__
    self.determine_value(record)
  File "/opt/odoo/odoo/odoo/fields.py", line 1098, in determine_value
    self.compute_value(recs)
  File "/opt/odoo/odoo/odoo/fields.py", line 1052, in compute_value
    self._compute_value(records)
  File "/opt/odoo/odoo/odoo/fields.py", line 1043, in _compute_value
    getattr(records, self.compute)()
  File "/opt/odoo/odoo/addons/product/models/product_template.py", line 288, in _compute_weight_uom_id
    product_template.weight_uom_id = weight_uom_id
  File "/opt/odoo/odoo/odoo/fields.py", line 1003, in __set__
    value = self.convert_to_cache(value, record)
  File "/opt/odoo/odoo/odoo/fields.py", line 2142, in convert_to_cache
    raise ValueError("Wrong value for %s: %r" % (self, value))
ValueError: Wrong value for product.template.weight_uom_id: product.template(7712,)
Could you help me to solve this problem and what is the origin?


Thank you very much!


Enrique



Avatar
Discard