diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/widgets/ordering/NewProductsController.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/widgets/ordering/NewProductsController.js index 054ab4439ef6d30b4f94c3ad9fea4e641de9c2a7..d646ecb4bc7bfa1254eaaa199d6bfd225547c98d 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/widgets/ordering/NewProductsController.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/widgets/ordering/NewProductsController.js @@ -53,6 +53,19 @@ function NewProductsController() { "ANNOTATION.REQUEST.QUANTITY_OF_ITEMS" : $($($productProperties[5]).children()[0]).val() } } + if(!newProduct.properties["$NAME"] && !newProduct.properties["$PRODUCT.CATALOG_NUM"]) { + Util.showError("Indicating a name or catalog number is mandatory for new products."); + return; + } + if(!newProduct.annotations["ANNOTATION.REQUEST.QUANTITY_OF_ITEMS"] || + parseInt(newProduct.annotations["ANNOTATION.REQUEST.QUANTITY_OF_ITEMS"]) <= 0) { + Util.showError("Indicating the quantity of items is mandatory for new requests."); + return; + } + if(!newProduct.parentsIdentifiers[0]) { + Util.showError("Indicating the provider is mandatory for new products."); + return; + } if(!newProduct.properties["$PRODUCT.CURRENCY"]) { delete newProduct.properties["$PRODUCT.CURRENCY"]; }