diff --git a/app/models/spree/order.rb b/app/models/spree/order.rb index 909cb1a529..f8d388c7fc 100644 --- a/app/models/spree/order.rb +++ b/app/models/spree/order.rb @@ -643,6 +643,10 @@ module Spree voucher.rate(self) end + def can_modify? + !shipped? && !canceled? + end + private def reapply_tax_on_changed_address diff --git a/app/views/spree/admin/orders/_shipment_manifest.html.haml b/app/views/spree/admin/orders/_shipment_manifest.html.haml index d08cf371c9..326818c59e 100644 --- a/app/views/spree/admin/orders/_shipment_manifest.html.haml +++ b/app/views/spree/admin/orders/_shipment_manifest.html.haml @@ -18,7 +18,7 @@ = line_item_shipment_price(line_item, item.quantity) %td.cart-item-delete.actions - - if shipment.can_modify? && can?(:update, shipment) + - if shipment.can_modify? && can?(:update, shipment) && shipment.can_modify? = link_to '', '#', :class => 'save-item icon_link icon-ok no-text with-tip', :data => {'shipment-number' => shipment.number, 'variant-id' => item.variant.id, :action => 'save'}, :title => t('actions.save'), :style => 'display: none' = link_to '', '#', :class => 'cancel-item icon_link icon-cancel no-text with-tip', :data => {:action => 'cancel'}, :title => t('actions.cancel'), :style => 'display: none' = link_to '', '#', :class => 'edit-item icon_link icon-edit no-text with-tip', :data => {:action => 'edit'}, :title => t('actions.edit') diff --git a/app/views/spree/admin/orders/edit.html.haml b/app/views/spree/admin/orders/edit.html.haml index 8d9023581d..8a3a832be3 100644 --- a/app/views/spree/admin/orders/edit.html.haml +++ b/app/views/spree/admin/orders/edit.html.haml @@ -24,7 +24,7 @@ = admin_inject_order_cycles(@order_cycles) %div{"ng-controller" => "orderCtrl", "ofn-distributor-id" => @order.distributor_id, "ofn-order-cycle-id" => @order.order_cycle_id} - = render :partial => 'add_product' if can?(:update, @order) + = render :partial => 'add_product' if can?(:update, @order) && @order.can_modify? - if @order.line_items.empty? .no-objects-found