Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3 Risposte
7383 Visualizzazioni

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
Abbandona

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

Autore Risposta migliore

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
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
apr 18
4982
0
nov 17
4420
0
dic 21
1679
2
ott 20
7607
1
feb 20
3206