References in BOM not sorted correctly (lp:#1848472)

[Original report](https://bugs.launchpad.net/bugs/1848472) created by **Piotr Gałka (piotrgalka)**
```
As bug system found the bug looking exactly as what I planned to write I
added my comment there even it was said it was fixed. But I got there ask
to report a new bug.

For me it looks that a sorting key function was changed to fix those bug,
but if that key function is used in construction ret.sort(...) it works
correct but when used in construction sorted(g, ...) works incorrect.
The older version of that key function also worked correctly in first
construction and not correctly in second.

Here is the text I have written there:

5.1.4 stable Win 7
*.py files dated 2019-08-10 17:13:08
I have noticed today that bom_csv_grouped_by_value_with_fp.py don't sorts
correctly.
It is even not a alphabetic sort.
I get the following sequence:

C1, C2, C3, C4, C30, C31, C32, C23, C21, C22, C13, C8, C7, C33, C35

I absolutelly don't know Python.
During:
https://forum.kicad.info/t/to-exclude-virtual-footprints-from-bom/19410
I ended with replacing in my (little modified) copy of
bom_csv_grouped_by_value_with_fp.py
gropued = net.groupComponents()
with
grouped = net.groupComponents(net.getInterestingComponents())
and noticed that except expected elimination from BOM elements marked with
NU in field Installed I also get elements sorted correctly.
In getInterestedComponents() there is used ret.sort(...) and
in groupComponents() there is used g = sorted(g, ...) with the same
function sortKey.
I don't know if that are two different sorting algorithms or two ways of
calling the same.

So I ended with double sorting - first with ret.sort(...) and next with g =
sorted(g,...) and getting the correctly sorted elements.

A moment ago I replaced in kicad_netlist_reader.py in function
groupComponents the line:
g = sorted(g, key=lambda g: sortKey(g.getRef()))
with:
g.sort(key=lambda g: sortKey(g.getRef()))
and it looks that groupComponents alone (without getInterestedComponents)
sorts references correctly.
I don't know if what I have done is save from Python point of view.

I think that it is good idea to eliminate uninstalled elements (like holes,
but not only) from BOM so I think the functionality of
getInterestedComponents() should be by default present in
bom_csv_grouped_by_value_with_fp.py and others.
My first idea was to eliminate elements having footprint with Fabrication
Attributes set to Virtual.
I'm not sure - may be it is simpler/better then adding extra field
"Installed" and give it a value "NU".

Application: KiCad
Version: (5.1.4)-1, release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.61.1 OpenSSL/1.1.1 (WinSSL) zlib/1.2.11 brotli/1.0.6
libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) nghttp2/1.34.0
Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit,
Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.68.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.61.1
    Compiler: GCC 8.2.0 with C++ ABI 1013

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON
```
Original tags: eeschema python

Story points: 6.0