This question has been flagged
3 Replies
6282 Views

Hey there,

say I have product in eCommerce and it's url is:

/shop/product/cake-123

If I delete or unpublish that product and someone calls it's url odoo generates 500 error.

How can I inform visitors what product was deleted or at least to generate 401 error?

Also log file is full of error messages and it is hard to see other errors.

Thank you.

 


Avatar
Discard

can you please update your question with the log, so we can find what happened

Author Best Answer

Hello, Guys,

thank you for your response. Here is a log:

2017-12-08 09:26:01,678 11322 ERROR db_v11 odoo.addons.website.models.ir_http: 500 Internal Server Error:
Traceback (most recent call last):
  File "/opt/odoo/odoo/fields.py", line 944, in __get__
    value = record.env.cache.get(record, self)
  File "/opt/odoo/odoo/api.py", line 960, in get
    value = self._data[field][record.id][key]
KeyError: <odoo.api.Environment object at 0x7f1717f899e8>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/opt/odoo/addons/http_routing/models/ir_http.py", line 425, in _postprocess_args
    _, path = rule.build(arguments)
  File "/opt/venv/lib/python3.6/site-packages/werkzeug/routing.py", line 798, in build
    add(self._converters[data].to_url(values[data]))
  File "/opt/odoo/addons/http_routing/models/ir_http.py", line 187, in to_url
    return slug(value)
  File "/opt/odoo/addons/http_routing/models/ir_http.py", line 88, in slug
    identifier, name = value.id, value.display_name
  File "/opt/odoo/odoo/fields.py", line 951, in __get__
    value = record.env.cache.get(record, self)
  File "/opt/odoo/odoo/api.py", line 961, in get
    return value.get() if isinstance(value, SpecialValue) else value
  File "/opt/odoo/odoo/api.py", line 993, in getter
    raise exception
  File "/opt/odoo/odoo/fields.py", line 1020, in compute_value
    self._compute_value(record)
  File "/opt/odoo/odoo/fields.py", line 1006, in _compute_value
    getattr(records, self.compute)()
  File "/opt/odoo/odoo/models.py", line 1420, in _compute_display_name
    names = dict(self.name_get())
  File "/opt/odoo/addons/product/models/product_template.py", line 330, in name_get
    for template in self]
  File "/opt/odoo/addons/product/models/product_template.py", line 330, in <listcomp>
    for template in self]
  File "/opt/odoo/odoo/fields.py", line 944, in __get__
    value = record.env.cache.get(record, self)
  File "/opt/odoo/odoo/api.py", line 961, in get
    return value.get() if isinstance(value, SpecialValue) else value
  File "/opt/odoo/odoo/api.py", line 993, in getter
    raise exception
  File "/opt/odoo/odoo/fields.py", line 1015, in compute_value
    self._compute_value(records)
  File "/opt/odoo/odoo/fields.py", line 1006, in _compute_value
    getattr(records, self.compute)()
  File "/opt/odoo/odoo/models.py", line 1420, in _compute_display_name
    names = dict(self.name_get())
  File "/opt/odoo/addons/product/models/product_template.py", line 330, in name_get
    for template in self]
  File "/opt/odoo/addons/product/models/product_template.py", line 330, in <listcomp>
    for template in self]
  File "/opt/odoo/odoo/fields.py", line 951, in __get__
    value = record.env.cache.get(record, self)
  File "/opt/odoo/odoo/api.py", line 961, in get
    return value.get() if isinstance(value, SpecialValue) else value
  File "/opt/odoo/odoo/api.py", line 993, in getter
    raise exception
  File "/opt/odoo/odoo/models.py", line 2523, in read
    values[name] = field.convert_to_read(record[name], record, use_name_get)
  File "/opt/odoo/odoo/models.py", line 4660, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/opt/odoo/odoo/fields.py", line 944, in __get__
    value = record.env.cache.get(record, self)
  File "/opt/odoo/odoo/api.py", line 961, in get
    return value.get() if isinstance(value, SpecialValue) else value
  File "/opt/odoo/odoo/api.py", line 993, in getter
    raise exception odoo.exceptions.MissingError: ('Record does not exist or has been deleted.', None)
Avatar
Discard
Best Answer

You get a 500 error code because of serious errors in your application deployment, not because of a product URL not found. If you want to deploy a software in order to use it, it is sometimes helpful to read the error messages and to solve the corresponding issues. If you are looking for help, please provide the necessary information, especially the log entries.

Avatar
Discard