Table for TakePOS module created only when module is enabled

This commit is contained in:
Laurent Destailleur 2023-03-15 15:54:40 +01:00
parent 9e68d98b4e
commit 388889a0e3
4 changed files with 7 additions and 4 deletions

View File

@ -158,8 +158,6 @@ class modLoan extends DolibarrModules
*/
public function init($options = '')
{
global $conf;
$result = $this->_load_tables('/install/mysql/', 'loan');
if ($result < 0) {
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')

View File

@ -269,11 +269,16 @@ class modTakePos extends DolibarrModules
dolibarr_set_const($db, "TAKEPOS_PRINT_METHOD", "browser", 'chaine', 0, '', $conf->entity);
$sql = array();
$result = $this->_load_tables('/install/mysql/', 'takepos');
if ($result < 0) {
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
}
// Remove permissions and default values
// Clean before activation
$this->remove($options);
$sql = array();
return $this->_init($sql, $options);
}