mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-11 07:24:15 +00:00
Further improvements
- Add callback for when a select2 form field is updated - Adjust selected quantity based on returned data - auto_fill the stock_item field
This commit is contained in:
@ -1426,6 +1426,11 @@ function initializeRelatedField(field, fields, options) {
|
||||
data = item.element.instance;
|
||||
}
|
||||
|
||||
// Run optional callback function
|
||||
if (field.onSelect && data) {
|
||||
field.onSelect(data, field, options);
|
||||
}
|
||||
|
||||
if (!data.pk) {
|
||||
return field.placeholder || '';
|
||||
}
|
||||
|
Reference in New Issue
Block a user