Adapt order_and_distributor_report to the new editable_orders query

This commit is contained in:
luisramos0
2019-12-11 12:05:36 +00:00
parent f63c7cf54f
commit 55eea21bb0

View File

@@ -44,7 +44,7 @@ module OpenFoodNetwork
# If empty array is passed in, the where clause will return all line_items, which is bad
orders_with_hidden_details =
@permissions.editable_orders.empty? ? orders : orders.where('id NOT IN (?)', @permissions.editable_orders)
@permissions.editable_orders.empty? ? orders : orders.where('spree_orders.id NOT IN (?)', @permissions.editable_orders)
orders.select{ |order| orders_with_hidden_details.include? order }.each do |order|
# TODO We should really be hiding customer code here too, but until we