2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-14 11:05:41 +00:00

Add SelectionList concept (#8054)

* Add SelectionList model, APIs and simple tests

* Add managment entries

* Add field to serializer

* add more tests for parameters

* Add support for SelectionList to CUI

* Add selection option to PUI

* fix display

* add PUI admin entries

* remove get_api_url

* fix modeldict

* Add models for meta

* Add test for inactive lists

* Add locking and testing for locking

* ignore unneeded section

* Add PUI testing for adding parameter

* Add selectionList admin

* also allow creating entries

* extend tests

* force click

* and more testing

* adapt test?

* more assurance?

* make test more robust

* more retries but shorter runs

* Update playwright.config.ts

* Add docs

* Add note regarding administration

* Adapt to https://github.com/inventree/InvenTree/pull/8093

* make help text more descriptive

* fix migration

* remove unneeded UI entries

* add lables and describtions to TableFields

* factor out selectionList forms

* add key to button

* cleanup imports

* add editable fields

* Add function to add row

* fix render warning

* remove dead parameter

* fix migrations

* fix migrations

* fix format

* autofix

* fix migrations

* fix create / update loop

* fix addition of empty lists

* extend tests

* adjust changelog entry

* fix updating loop

* update test name

* merge migrations

* simplify request

* - Add entry count to list
- Move parameter table to default accordion

* fix test

* fix test clearing section

---------

Co-authored-by: Oliver Walters <oliver.henry.walters@gmail.com>
This commit is contained in:
Matthias Mair
2024-11-27 03:30:39 +01:00
committed by GitHub
parent 20fb1250f8
commit af39189e7e
28 changed files with 1278 additions and 11 deletions

View File

@ -26,6 +26,7 @@ Parameter templates are used to define the different types of parameters which a
| Units | Optional units field (*must be a valid [physical unit](#parameter-units)*) |
| Choices | A comma-separated list of valid choices for parameter values linked to this template. |
| Checkbox | If set, parameters linked to this template can only be assigned values *true* or *false* |
| Selection List | If set, parameters linked to this template can only be assigned values from the linked [selection list](#selection-lists) |
### Create Template
@ -105,3 +106,12 @@ Parameter sorting takes unit conversion into account, meaning that values provid
{% with id="sort_by_param_units", url="part/part_sorting_units.png", description="Sort by Parameter Units" %}
{% include 'img.html' %}
{% endwith %}
### Selection Lists
Selection Lists can be used to add a large number of predefined values to a parameter template. This can be useful for parameters which must be selected from a large predefined list of values (e.g. a list of standardised colo codes). Choices on templates are limited to 5000 characters, selection lists can be used to overcome this limitation.
It is possible that plugins lock selection lists to ensure a known state.
Administration of lists can be done through the Part Parameter section in the Admin Center or via the API.