Skip to content

Commit

Permalink
don't apply tags if the order is created by admin
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewpbrett committed Jan 9, 2021
1 parent d5687a3 commit a36c2bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/controllers/spree/admin/orders_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def load_distribution_choices
def ensure_distribution
unless @order
@order = Spree::Order.new
@order.created_by = spree_current_user
@order.generate_order_number
@order.save!
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/spree/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ def create_proposed_shipments
shipments.destroy_all

packages = OrderManagement::Stock::Coordinator.new(self).packages(
checkout: true, apply_tags: true
checkout: true, apply_tags: !created_by&.admin?
)
packages.each do |package|
shipments << package.to_shipment
Expand Down

0 comments on commit a36c2bf

Please sign in to comment.