From 25a01be995076f66901cf367cef67f094b86f56f Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 29 Jun 2021 09:25:40 +1000 Subject: [PATCH] Added warning message for missing model information --- InvenTree/templates/js/forms.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/InvenTree/templates/js/forms.js b/InvenTree/templates/js/forms.js index 318dfab1b4..7f66a9fd30 100644 --- a/InvenTree/templates/js/forms.js +++ b/InvenTree/templates/js/forms.js @@ -726,8 +726,9 @@ function initializeRelatedField(name, field, options) { // If the 'model' is specified, hand it off to the custom model render return renderModelData(name, field.model, item, field, options); } else { - // Simply render the 'text' parameter - return item.text; + // Return a simple renderering + console.log(`WARNING: templateResult() missing 'field.model' for '${name}'`); + return `${name} - ${item.id}`; } }, 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 return renderModelData(name, field.model, item, field, options); } else { - // Simply render the 'text' parameter - return item.text; + // Return a simple renderering + console.log(`WARNING: templateSelection() missing 'field.model' for '${name}'`); + return `${name} - ${item.id}`; } } });