diff --git a/app/models/spree/adjustment.rb b/app/models/spree/adjustment.rb index 942e7fc149..e171202e9f 100644 --- a/app/models/spree/adjustment.rb +++ b/app/models/spree/adjustment.rb @@ -106,8 +106,8 @@ module Spree # more than on line items at once via accepted_nested_attributes the order # object on the association would be in a old state and therefore the # adjustment calculations would not performed on proper values - def update!(calculable = nil) - return if immutable? + def update!(calculable = nil, force: false) + return if immutable? && !force # Fix for Spree issue #3381 # If we attempt to call 'source' before the reload, then source is currently diff --git a/app/models/spree/order.rb b/app/models/spree/order.rb index 2022ecb37a..f9f53edc08 100644 --- a/app/models/spree/order.rb +++ b/app/models/spree/order.rb @@ -857,11 +857,8 @@ module Spree def update_adjustment!(adjustment) return if adjustment.finalized? - state = adjustment.state - adjustment.state = 'open' - adjustment.update! + adjustment.update!(force: true) update! - adjustment.state = state end # object_params sets the payment amount to the order total, but it does this