From 540b09c506cfeb593a8cb3e030a9dbcb67d61c30 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 20 Jul 2023 17:45:45 +0100 Subject: [PATCH] Possible alternative to fixing #13296 - custom report failing when the model is busted Related: https://github.com/snipe/snipe-it/pull/13297 Signed-off-by: snipe --- app/Models/Asset.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Asset.php b/app/Models/Asset.php index 861269d5f243..95e1c3a16625 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -390,7 +390,7 @@ public function validationRules() */ public function depreciation() { - return $this->model->belongsTo(\App\Models\Depreciation::class, 'depreciation_id'); + return $this->hasOneThrough(\App\Models\Depreciation::class,\App\Models\AssetModel::class,'id','id','model_id','depreciation_id'); }