Merge pull request #7794 from artoscinote/ma_SCI_10975

Fix stock field in item card for disabled stock management [SCI-10975]
This commit is contained in:
Martin Artnik 2024-08-12 12:51:34 +02:00 committed by GitHub
commit ce4f79e645
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -89,6 +89,8 @@ export default {
},
methods: {
enableEditing() {
if (!this.values.stock_url) return;
this.isEditing = true;
const $this = this;
// disable edit

View file

@ -24,7 +24,7 @@ json.actions do
end
end
json.direct_file_upload_path rails_direct_uploads_url
if @repository_row.has_stock?
if @repository_row.has_stock? && @repository.has_stock_management?
json.stock_value_url edit_repository_stock_repository_repository_row_url(@repository, @repository_row)
elsif @repository.has_stock_management?
json.stock_value_url new_repository_stock_repository_repository_row_url(@repository, @repository_row)