diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index c6d2ab46ff6..6b482f8f7ee 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -1494,6 +1494,7 @@ class Propal extends CommonObject
$this->fk_project = $obj->fk_project;
$this->project = null; // Clear if another value was already set by fetch_projet
+ $this->model_pdf = $obj->model_pdf;
$this->modelpdf = $obj->model_pdf;
$this->last_main_doc = $obj->last_main_doc;
$this->note = $obj->note_private; // TODO deprecated
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index a30d04fd761..7deccba7401 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -1824,6 +1824,7 @@ class Commande extends CommonOrder
$this->note = $obj->note_private; // deprecated
$this->note_private = $obj->note_private;
$this->note_public = $obj->note_public;
+ $this->model_pdf = $obj->model_pdf;
$this->modelpdf = $obj->model_pdf;
$this->last_main_doc = $obj->last_main_doc;
$this->mode_reglement_id = $obj->fk_mode_reglement;
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 50b84840901..b5e3e61a18f 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -1581,6 +1581,7 @@ class Facture extends CommonInvoice
$this->note_public = $obj->note_public;
$this->user_author = $obj->fk_user_author;
$this->user_valid = $obj->fk_user_valid;
+ $this->model_pdf = $obj->model_pdf;
$this->modelpdf = $obj->model_pdf;
$this->last_main_doc = $obj->last_main_doc;
$this->situation_cycle_ref = $obj->situation_cycle_ref;
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index ab94e73b58c..03dd6883011 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -726,6 +726,7 @@ class Contrat extends CommonObject
$this->note_private = $obj->note_private;
$this->note_public = $obj->note_public;
+ $this->model_pdf = $obj->model_pdf;
$this->modelpdf = $obj->model_pdf;
$this->fk_projet = $obj->fk_project; // deprecated
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 4ccabb364b7..46fb7141a12 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -314,7 +314,7 @@ abstract class CommonObject
* @var string
* @see SetDocModel()
*/
- public $modelpdf;
+ public $model_pdf;
/**
* @var string
@@ -2375,7 +2375,8 @@ abstract class CommonObject
$resql = $this->db->query($sql);
if ($resql)
{
- $this->modelpdf = $modelpdf;
+ $this->model_pdf = $modelpdf;
+ $this->modelpdf = $modelpdf; // For bakward compatibility
return 1;
} else {
dol_print_error($this->db);
@@ -4538,7 +4539,7 @@ abstract class CommonObject
* Common function for all objects extending CommonObject for generating documents
*
* @param string $modelspath Relative folder where generators are placed
- * @param string $modele Generator to use. Caller must set it to obj->modelpdf or GETPOST('modelpdf','alpha') for example.
+ * @param string $modele Generator to use. Caller must set it to obj->model_pdf or GETPOST('model_pdf','alpha') for example.
* @param Translate $outputlangs Output language to use
* @param int $hidedetails 1 to hide details. 0 by default
* @param int $hidedesc 1 to hide product description. 0 by default
diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php
index 11c8b8ef1c6..478197d2c2b 100644
--- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php
+++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php
@@ -50,8 +50,7 @@ class doc_generic_stock_odt extends ModelePDFStock
public $phpmin = array(5, 6);
/**
- * Dolibarr version of the loaded document
- * @var string
+ * @var string Dolibarr version of the loaded document
*/
public $version = 'dolibarr';
@@ -116,16 +115,10 @@ class doc_generic_stock_odt extends ModelePDFStock
$form = new Form($this->db);
$texte = $this->description.".
\n";
- $texte .= '