mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
13221 - Don't allow shipped orders to be editable
This commit is contained in:
@@ -643,6 +643,10 @@ module Spree
|
||||
voucher.rate(self)
|
||||
end
|
||||
|
||||
def can_modify?
|
||||
!shipped? && !canceled?
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def reapply_tax_on_changed_address
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user