mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 03:00:54 +00:00
Parameter types (#4935)
* Add fields to PartParameterTemplateModel - checkbox: Is the field a 'checkbox' - choices: List of valid options * Update javascript * Adds unit test for PartParameterTemplate - Checkbox cannot have units - Checkbox cannot have choices - Choices must be unique * Improve API filtering - Add "has_choices" filter - Add "has_units" filter * Prune dead code * Update js functions for creating / editing parameters * Update part parameter form - Rebuild the "data" field based on the selected template - Supports "string" / "boolean" / "select" * Adjust data input based on parameter type - Choice displays available options - Checkbox displays boolean switch - Otherwise displays text input - Adds more unit testing - Updates to forms.js for improved functionality * Calculate numeric value for boolean parameters * Update docs * Bump API version
This commit is contained in:
@ -216,6 +216,8 @@ class PartParameterTemplateSerializer(InvenTree.serializers.InvenTreeModelSerial
|
||||
'name',
|
||||
'units',
|
||||
'description',
|
||||
'checkbox',
|
||||
'choices',
|
||||
]
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user