2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-12-16 17:28:11 +00:00

Fix for string form fields (#10814)

* Fix for string form fields

- replace null values with empty strings

* Expose more serializer metadata

* Check if null values are not allowed

* Fix type

* Try removing feature

* Reduce deltas

* Remove extra field attrs entirely (for testing)

* Comment out changes

* Tweak form values

* Fix for form validation
This commit is contained in:
Oliver
2025-12-06 22:54:29 +11:00
committed by GitHub
parent ffec087618
commit efc8fb816d
3 changed files with 37 additions and 7 deletions

View File

@@ -420,6 +420,13 @@ class InvenTreeMetadata(SimpleMetadata):
if field_info['type'] == 'dependent field':
field_info['depends_on'] = field.depends_on
# Extends with extra attributes from the serializer
extra_field_attributes = ['allow_blank', 'allow_null']
for attr in extra_field_attributes:
if hasattr(field, attr):
field_info[attr] = getattr(field, attr)
# Extend field info if the field has a get_field_info method
if (
not field_info.get('read_only')