mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Remove StockLocation from ReturnAuthorization
We have only one default location and don't need it associated to anything.
This commit is contained in:
@@ -23,7 +23,7 @@ module Spree
|
||||
|
||||
def permitted_resource_params
|
||||
params.require(:return_authorization).
|
||||
permit(:amount, :reason, :stock_location_id)
|
||||
permit(:amount, :reason)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user