diff --git a/app/Models/EntityModel.php b/app/Models/EntityModel.php index ef6322f9ab30..6bc0c5b290fc 100644 --- a/app/Models/EntityModel.php +++ b/app/Models/EntityModel.php @@ -158,7 +158,7 @@ class EntityModel extends Eloquent } } - if (Auth::check() && ! Auth::user()->hasPermission('view_all') && $this->getEntityType() != ENTITY_TAX_RATE) { + if (Auth::check() && ! Auth::user()->hasPermission('view_all') && method_exists($this, 'getEntityType') && $this->getEntityType() != ENTITY_TAX_RATE) { $query->where(Utils::pluralizeEntityType($this->getEntityType()) . '.user_id', '=', Auth::user()->id); }