[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#88503 X-original-commit: e1be4b5c2dca0ca11bad724a4714f5f71c16de4f Signed-off-by: Martin Trigaux (mat) <mat@odoo.com> Signed-off-by: Julien Castiaux <juc@odoo.com>
This commit is contained in:
committed by
Martin Trigaux
parent
f57f611dcc
commit
a915535746
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user