Skip to content
Snippets Groups Projects
Commit e1be4b5c authored by Karthik, Sodexis's avatar Karthik, Sodexis Committed by Martin Trigaux
Browse files

[FIX] website_slides: correctly retrieve xmlid lookup result


This commit is to prevent "AttributeError: 'NoneType' object has no
attribute '_name'"
When an xmlid does not exists, the _xmlid_to_obj returns None and the
condition was failing when trying to retrive the model name.

Closes odoo/odoo#88273

closes odoo/odoo#88392

Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
parent 0152983a
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ class Http(models.AbstractModel):
obj = None
if xmlid:
obj = self._xmlid_to_obj(self.env, xmlid)
if obj._name != 'slide.slide':
if obj and obj._name != 'slide.slide':
obj = None
elif id and model == 'slide.slide':
obj = self.env[model].browse(int(id))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment