2
0
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:
Oliver
2021-10-20 23:03:03 +11:00
parent f7b6c68237
commit 92568748cf
2 changed files with 23 additions and 2 deletions

View File

@ -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 || '';
}