mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-26 09:43:29 +08:00
Merge pull request #7242 from G-Chubinidze/gc_SCI_10251_v2
Inventory duplicating removes old inventory stock units [SCI-10251]
This commit is contained in:
commit
e7bd0d5764
1 changed files with 4 additions and 1 deletions
|
@ -240,7 +240,10 @@ class RepositoriesController < ApplicationController
|
|||
copied_repo_stock_column = copied_repository.repository_columns.find_by(data_type: 'RepositoryStockValue')
|
||||
|
||||
if old_repo_stock_column && copied_repo_stock_column
|
||||
copied_repo_stock_column.repository_stock_unit_items = old_repo_stock_column.repository_stock_unit_items
|
||||
old_repo_stock_column.repository_stock_unit_items.each do |item|
|
||||
copied_item = item.dup
|
||||
copied_repo_stock_column.repository_stock_unit_items << copied_item
|
||||
end
|
||||
copied_repository.save!
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue