mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Tweaks for existing form code
This commit is contained in:
parent
64bbcd2570
commit
f2806b2e41
@ -1780,6 +1780,11 @@ function initializeRelatedField(field, fields, options={}) {
|
||||
// Only a single result is available, given the provided filters
|
||||
if (data.count == 1) {
|
||||
setRelatedFieldData(name, data.results[0], options);
|
||||
|
||||
// Run "callback" function (if supplied)
|
||||
if (field.onEdit) {
|
||||
field.onEdit(data.results[0], name, field, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -371,10 +371,16 @@ function renderSupplierPart(name, data, parameters, options) {
|
||||
var html = '';
|
||||
|
||||
html += select2Thumbnail(supplier_image);
|
||||
html += select2Thumbnail(part_image);
|
||||
|
||||
if (data.part_detail) {
|
||||
html += select2Thumbnail(part_image);
|
||||
}
|
||||
|
||||
html += ` <span><b>${data.supplier_detail.name}</b> - ${data.SKU}</span>`;
|
||||
html += ` - <i>${data.part_detail.full_name}</i>`;
|
||||
|
||||
if (data.part_detail) {
|
||||
html += ` - <i>${data.part_detail.full_name}</i>`;
|
||||
}
|
||||
|
||||
html += `<span class='float-right'><small>{% trans "Supplier Part ID" %}: ${data.pk}</small></span>`;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user