diff --git a/ChangeLog b/ChangeLog
index ed418b08f5c77eeef61b23fdba41b39289936095..4a1e6ca357661c3171689206c291fc2a316c651b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -35,6 +35,7 @@ For developers:
 - New: Function yn can show a visual checkbox.
 - New: Introduced select2 jquery plugin.
 - New: Possibility to add javascript in main login page with "getLoginPageOptions" hook
+- New: possibility to defined a tab for all entities in module descriptor
 
 WARNING: Following changes may create regression for some external modules, but was necessary to make
 Dolibarr better:
diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php
index 472e260cfa6c3eeacaf66f78c912bf0c61ba14a0..89d65a7d5d76e26a6f36881c30032173a76b0f33 100644
--- a/htdocs/core/modules/DolibarrModules.class.php
+++ b/htdocs/core/modules/DolibarrModules.class.php
@@ -1000,7 +1000,18 @@ print $sql;
             $i=0;
             foreach ($this->tabs as $key => $value)
             {
-                if ($value)
+            	if (is_array($value) && count($value) == 0) continue;	// Discard empty arrays
+
+            	$entity=$conf->entity;
+            	$newvalue = $value;
+
+            	if (is_array($value))
+            	{
+            		$newvalue = $value['data'];
+            		if (isset($value['entity'])) $entity = $value['entity'];
+            	}
+
+                if ($newvalue)
                 {
                     $sql = "INSERT INTO ".MAIN_DB_PREFIX."const (";
                     $sql.= "name";