InvenTree icon indicating copy to clipboard operation
InvenTree copied to clipboard

[FR] Filter part does not allow to handle variants to include or exclude only

Open skydiablo opened this issue 1 year ago • 4 comments

Please verify that this bug has NOT been raised before.

  • [x] I checked and didn't find a similar issue

Describe the bug*

in the part section the overview table does not allow to add a filter to handle variants? i can not exclude or include variants!

Steps to Reproduce

try to add a list filter "variants include/exclude" on part view

Expected behaviour

an option to filter variants in parts list view table

Deployment Method

  • [ ] Docker
  • [ ] Package
  • [x] Bare metal
  • [ ] Other - added info in Steps to Reproduce

Version Information

Version Information:

InvenTree-Version: 0.16.8 Django Version: 4.2.15

Database: sqlite3 Debug-Mode: False Deployed using Docker: False Platform: Linux-6.8.12-2-pve-x86_64-with-glibc2.31 Installer: None

Active plugins: [{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.1.0'}, {'name': 'InvenTreeCoreNotificationsPlugin', 'slug': 'inventreecorenotificationsplugin', 'version': '1.0.0'}, {'name': 'InvenTreeCurrencyExchange', 'slug': 'inventreecurrencyexchange', 'version': '1.0.0'}, {'name': 'InvenTreeLabel', 'slug': 'inventreelabel', 'version': '1.1.0'}, {'name': 'InvenTreeLabelMachine', 'slug': 'inventreelabelmachine', 'version': '1.0.0'}, {'name': 'InvenTreeLabelSheet', 'slug': 'inventreelabelsheet', 'version': '1.0.0'}, {'name': 'DigiKeyPlugin', 'slug': 'digikeyplugin', 'version': '1.0.0'}, {'name': 'LCSCPlugin', 'slug': 'lcscplugin', 'version': '1.0.0'}, {'name': 'MouserPlugin', 'slug': 'mouserplugin', 'version': '1.0.0'}, {'name': 'TMEPlugin', 'slug': 'tmeplugin', 'version': '1.0.0'}, {'name': 'IPNGenerator', 'slug': 'ipngen', 'version': '0.1'}]

Please verify if you can reproduce this bug on the demo site.

  • [x] I can reproduce this bug on the demo site.

Relevant log output

No response

skydiablo avatar Nov 08 '24 12:11 skydiablo

@skydiablo this would be a reasonable addition as a new filter. Would you like to look into this one potentially? It would be a simple first-time issue, I can point you to the right places in code where it would need to be implemented

SchrodingersGat avatar Nov 09 '24 09:11 SchrodingersGat

Sure, the given Tech Stack is not my, but hold my Beer, how strong could that be 😉

skydiablo avatar Nov 11 '24 12:11 skydiablo

Getting Started

Getting setup with a vscode devcontainer is the easiest way to start developing:

https://docs.inventree.org/en/stable/develop/devcontainer/

Backend

You will need to add a new filter attribute to the PartFilter class:

https://github.com/inventree/InvenTree/blob/ea1cc4d8dcbc3caad8625b351a7051278ef7fce9/src/backend/InvenTree/part/api.py#L887

You can use the is_revision filter as a starting point:

https://github.com/inventree/InvenTree/blob/ea1cc4d8dcbc3caad8625b351a7051278ef7fce9/src/backend/InvenTree/part/api.py#L899

Frontend

Add a new filter option to the PartTable component:

https://github.com/inventree/InvenTree/blob/ea1cc4d8dcbc3caad8625b351a7051278ef7fce9/src/frontend/src/tables/part/PartTable.tsx#L174

Let me know if you run into any issues or questions!

SchrodingersGat avatar Nov 11 '24 22:11 SchrodingersGat

@skydiablo I have assigned a provisional milestone, no one will hold you that, this is just for book (and bot) keeping reasons

matmair avatar Nov 11 '24 23:11 matmair

This was closed in https://github.com/inventree/InvenTree/pull/9077

SchrodingersGat avatar Oct 19 '25 03:10 SchrodingersGat