From bec0e9983fb631a5b42b09541bbd6727061251fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Sun, 22 Jun 2025 12:13:16 +0200 Subject: [PATCH] create invoice and order categorie table when we enable it (#34450) * create invoice and order categorie table if not enabled * Update modFacture.class.php * Update modCommande.class.php * Update modCategorie.class.php * Update modCommande.class.php * Update modFacture.class.php * Update modCategorie.class.php * Update modCommande.class.php * Update modFacture.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/core/modules/modCategorie.class.php | 8 ++++++++ htdocs/core/modules/modCommande.class.php | 2 ++ htdocs/core/modules/modFacture.class.php | 2 ++ 3 files changed, 12 insertions(+) diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index dc10152beb6..1aa9baf562f 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -7,6 +7,7 @@ * Copyright (C) 2024 MDW * Copyright (C) 2025 Frédéric France * Copyright (C) 2025 Alexandre Spangaro + * Copyright (C) 2025 Charlene Benke * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -937,6 +938,13 @@ class modCategorie extends DolibarrModules */ public function init($options = '') { + if (isModEnabled("invoice")) { + $this->_load_tables('/install/mysql/', 'facture'); + } + if (isModEnabled("order")) { + $this->_load_tables('/install/mysql/', 'commande'); + } + // Permissions $this->remove($options); diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index 0cb76c36513..ec760130681 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -456,6 +456,8 @@ class modCommande extends DolibarrModules { global $conf, $langs; + $this->_load_tables('/install/mysql/', 'commande'); + // Permissions $this->remove($options); diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 62d52029dd2..2f06ce702fc 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -775,6 +775,8 @@ class modFacture extends DolibarrModules { global $conf, $langs; + $this->_load_tables('/install/mysql/', 'facture'); + // Remove permissions and default values $this->remove($options);