Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove StockLocation from ReturnAuthorization #12914

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def associate_inventory_units

def permitted_resource_params
params.require(:return_authorization).
permit(:amount, :reason, :stock_location_id)
permit(:amount, :reason)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/spree/return_authorization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

module Spree
class ReturnAuthorization < ApplicationRecord
self.ignored_columns += [:stock_location_id]
acts_as_paranoid

belongs_to :order, class_name: 'Spree::Order', inverse_of: :return_authorizations

has_many :inventory_units, inverse_of: :return_authorization, dependent: :nullify
has_one :stock_location, dependent: nil
before_save :force_positive_amount
before_create :generate_number

Expand Down
5 changes: 0 additions & 5 deletions app/views/spree/admin/return_authorizations/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,3 @@
= f.label :reason, t('.reason')
= f.text_area :reason, { style: 'height:100px;', class: 'fullwidth' }
= f.error_message_on :reason

= f.field_container :stock_location do
= f.label :stock_location, t('.stock_location')
= f.select :stock_location_id, Spree::StockLocation.all.collect{ |l| [l.name, l.id] }, { style: 'height:100px;', class: 'fullwidth' }
= f.error_message_on :reason
Loading