[11.0][IMP] Add tests

This commit is contained in:
Jaime Arroyo
2020-01-10 12:40:30 +01:00
committed by Olga Marco
parent 521afb5864
commit e55c2208ae
4 changed files with 36 additions and 1 deletions

View File

@@ -8,7 +8,7 @@ class Base(models.AbstractModel):
_inherit = 'base'
def _get_record_parents(self, field):
if not self:
if not self or not hasattr(self, self._parent_name):
return []
return getattr(
self, self._parent_name