Show only suppliers with articles in the dropdown-menu for new orders

When there are many suppliers to be able to select them for invoices,
the menu for creating new orders gets unclear.
This commit is contained in:
Patrick Gansterer 2015-02-18 22:23:39 +01:00
parent 65c7673a41
commit 5b309d3d51
1 changed files with 1 additions and 1 deletions

View File

@ -6,7 +6,7 @@
= t '.new_order'
%span.caret
%ul.dropdown-menu
- Supplier.undeleted.order('suppliers.name ASC').each do |supplier|
- Supplier.where(id: Article.undeleted.select(:supplier_id).distinct).order('suppliers.name ASC').each do |supplier|
%li= link_to supplier.name, new_order_path(supplier_id: supplier.id), tabindex: -1
.well