In case Model for document generation is not defined, the criteria to select the model is now:

1. Model for the object
 2. Custom default module
 3. Hardcoded default module
This commit is contained in:
Marcos García de La Fuente
2017-01-16 21:16:05 +01:00
parent da64d4d398
commit e0cbcadd98
12 changed files with 94 additions and 120 deletions

View File

@@ -3641,17 +3641,15 @@ class Commande extends CommonOrder
$langs->load("orders");
// Positionne le modele sur le nom du modele a utiliser
if (! dol_strlen($modele))
{
if (! empty($conf->global->COMMANDE_ADDON_PDF))
{
if (! dol_strlen($modele)) {
$modele = 'einstein';
if ($this->modelpdf) {
$modele = $this->modelpdf;
} elseif (! empty($conf->global->COMMANDE_ADDON_PDF)) {
$modele = $conf->global->COMMANDE_ADDON_PDF;
}
else
{
$modele = 'einstein';
}
}
$modelpath = "core/modules/commande/doc/";