Prevent voucher adjustment from bein updated when update is called

This commit is contained in:
Gaetan Craig-Riou
2023-06-26 14:43:25 +10:00
parent 87790b29ae
commit 366cca7984

View File

@@ -137,7 +137,10 @@ module OrderManagement
end
def update_all_adjustments
order.all_adjustments.reload.each(&:update_adjustment!)
# Voucher are modelled as a Spree::Adjustment but they don't behave like all the other
# adjustments, so we don't want voucher adjustment to be updated here.
# Calculation are handled by VoucherAdjustmentsService.calculate
order.all_adjustments.non_voucher.reload.each(&:update_adjustment!)
end
def before_save_hook