Bring in shipment state updating from Spree 2.2

This commit is contained in:
Matt-Yorkley
2021-04-28 21:43:28 +01:00
parent 2fda550821
commit 290c1d0ebf
2 changed files with 10 additions and 0 deletions

View File

@@ -331,6 +331,15 @@ module Spree
fee_adjustment.finalize!
send_shipped_email
touch :shipped_at
update_order_shipment_state
end
def update_order_shipment_state
new_state = order.updater.update_shipment_state
order.update_columns(
shipment_state: new_state,
updated_at: Time.now,
)
end
def send_shipped_email

View File

@@ -101,6 +101,7 @@ module OrderManagement
end
order.state_changed('shipment')
order.shipment_state
end
# Updates the +payment_state+ attribute according to the following logic: