2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-30 20:46:47 +00:00

Added warning message for missing model information

This commit is contained in:
Oliver 2021-06-29 09:25:40 +10:00
parent c3ef8d2dfb
commit 25a01be995

View File

@ -726,8 +726,9 @@ function initializeRelatedField(name, field, options) {
// If the 'model' is specified, hand it off to the custom model render // If the 'model' is specified, hand it off to the custom model render
return renderModelData(name, field.model, item, field, options); return renderModelData(name, field.model, item, field, options);
} else { } else {
// Simply render the 'text' parameter // Return a simple renderering
return item.text; console.log(`WARNING: templateResult() missing 'field.model' for '${name}'`);
return `${name} - ${item.id}`;
} }
}, },
templateSelection: function(item, container) { templateSelection: function(item, container) {
@ -736,8 +737,9 @@ function initializeRelatedField(name, field, options) {
// If the 'model' is specified, hand it off to the custom model render // If the 'model' is specified, hand it off to the custom model render
return renderModelData(name, field.model, item, field, options); return renderModelData(name, field.model, item, field, options);
} else { } else {
// Simply render the 'text' parameter // Return a simple renderering
return item.text; console.log(`WARNING: templateSelection() missing 'field.model' for '${name}'`);
return `${name} - ${item.id}`;
} }
} }
}); });