diff --git a/app/models/spree/line_item_decorator.rb b/app/models/spree/line_item_decorator.rb index 8744c4af..5a2dc0b8 100644 --- a/app/models/spree/line_item_decorator.rb +++ b/app/models/spree/line_item_decorator.rb @@ -52,6 +52,14 @@ def quantity_without_part_line_items(quantity) hash[ap.part] = ap.count * quantity end end + + def verify_order_inventory_before_destroy + if product.assembly? + Spree::OrderInventoryAssembly.new(self).verify(target_shipment) + else + Spree::OrderInventory.new(order, self).verify(target_shipment) + end + end end Spree::LineItem.prepend Spree::LineItemDecorator