From b7082c62127a0224c683a0524e345c155246c7db Mon Sep 17 00:00:00 2001 From: Sam Seed Date: Wed, 11 Jan 2023 12:26:25 +0000 Subject: [PATCH] feat: don't set log owning org as user's org if that org doesn't hold stock --- app/controllers/logs_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/logs_controller.rb b/app/controllers/logs_controller.rb index 3982d4a54..083d40178 100644 --- a/app/controllers/logs_controller.rb +++ b/app/controllers/logs_controller.rb @@ -60,8 +60,9 @@ private end def org_params + owning_organisation_id = current_user.organisation.holds_own_stock? ? current_user.organisation.id : nil { - "owning_organisation_id" => current_user.organisation.id, + "owning_organisation_id" => owning_organisation_id, "managing_organisation_id" => current_user.organisation.id, "created_by_id" => current_user.id, }