// Added warning for supply orders if there is not at least one warehouse

This commit is contained in:
bMancone committed 2012-01-02 14:27:31 +00:00
1 parent 6c865dd54c
commit 59902d47b5
2 files changed
+17 -14

No files matched your search

@@ -268,20 +268,19 @@
$(".import_products_categories").hide(); $(".import_products_categories").hide();
$("#entitie").html($("#entity > option:selected").text().toLowerCase()); $("#entitie").html($("#entity > option:selected").text().toLowerCase());
$.getJSON("ajax.php", $.getJSON("ajax.php", {
{ getAvailableFields:1,
getAvailableFields:1, entity: $("#entity").val()
entity: $("#entity").val() },
}, function(j) {
function(j) var fields = "";
{ $("#availableFields").empty();
var fields = ""; for (var i = 0; i < j.length; i++)
$("#availableFields").empty(); fields += j[i].field;
for (var i = 0; i < j.length; i++) $("#availableFields").html(fields);
fields += j[i].field; activeClueTip();
$("#availableFields").html(fields); }
activeClueTip(); );
});
}); });
</script> </script>
@@ -179,6 +179,10 @@ class AdminSupplyOrdersControllerCore extends AdminController
//get warehouses list //get warehouses list
$warehouses = Warehouse::getWarehouses(true); $warehouses = Warehouse::getWarehouses(true);
// displays warning if there are no warehouses
if (!$warehouses)
$this->displayWarning($this->l('You must have at least one warehouse. See Stock/Warehouses'));
//get currencies list //get currencies list
$currencies = Currency::getCurrencies(); $currencies = Currency::getCurrencies();