# Ticket labels are not replaced in the odt file

**URL:** <https://www.dolibarr.org/forum/t/ticket-labels-are-not-replaced-in-the-odt-file/30925>\
**Category:** Using my Dolibarr\
**Tags:** Help\
**Created:** [January 20, 2026, 3:25pm UTC](https://www.dolibarr.org/forum/t/ticket-labels-are-not-replaced-in-the-odt-file/30925 "2026-01-20T15:25:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ccabrera\_mex](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/c/7bcc69/32.png) [@ccabrera\_mex](https://www.dolibarr.org/forum/u/ccabrera_mex)\
**Post date:** [January 20, 2026, 3:25pm UTC](https://www.dolibarr.org/forum/t/ticket-labels-are-not-replaced-in-the-odt-file/30925/1 "2026-01-20T15:25:45Z")

</div>

Hi!

I’m experiencing a strange issue with version 22.0.3. Even in the example ODT template, only tags starting with “mycompany” are being replaced, while all others are ignored.

I performed a couple of clean test installations on Linux and Windows, and it does the same thing.

Has anyone else experienced this?

---

<div class="post-metadata">

**Author:** ![umigun](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/umigun/32/7276_2.png) [@umigun](https://www.dolibarr.org/forum/u/umigun)\
**Post date:** [January 22, 2026, 7:29am UTC](https://www.dolibarr.org/forum/t/ticket-labels-are-not-replaced-in-the-odt-file/30925/2 "2026-01-22T07:29:08Z")

</div>

> [@ccabrera\_mex](#):
>
> mycompany

Check the translations to see if there’s a translation for the word.

---

<div class="post-metadata">

**Author:** ![ccabrera\_mex](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/c/7bcc69/32.png) [@ccabrera\_mex](https://www.dolibarr.org/forum/u/ccabrera_mex)\
**Post date:** [January 22, 2026, 6:38pm UTC](https://www.dolibarr.org/forum/t/ticket-labels-are-not-replaced-in-the-odt-file/30925/3 "2026-01-22T18:38:47Z")

</div>

Hi!

Thanks for the tip.

I found the solution. In the file that processes the ODT format: doc\_generic\_ticket\_odt.modules.php, the object substitution wasn’t being called. This file contained a procedure to generate the substitution array (similar to the one in commondocgenerator.class.php).

The line to call the method is:  
$array\_object = $this-\>get\_substitutionarray\_object($object, $outputlangs);

The code I left in the doc\_generic\_ticket\_odt.modules.php file for the replacement is as follows:

public function get\_substitutionarray\_object($object, $outputlangs, $array\_key = ‘object’)  
{  
//This is the code copied from commondocgenerator.class.php  
// phpcs:enable  
global $extrafields;

$resarray = array(  
$array\_key.‘\_id’ =\> $object-\>id,  
$array\_key.‘\_ref’ =\> (property\_exists($object, ‘ref’) ? $object-\>ref : ‘’),  
$array\_key.‘\_subject’ =\> (property\_exists($object, ‘subject’) ? $object-\>subject : ‘’),  
$array\_key.‘\_message’ =\> (property\_exists($object, ‘message’) ? $object-\>message : ‘’),  
$array\_key.‘\_progress’ =\> (property\_exists($object, ‘progress’) ? $object-\>progress : ‘’),  
$array\_key.‘\_type’ =\> (property\_exists($object, ‘type\_code’) ? $object-\>type\_code : ‘’),  
$array\_key.‘\_severity\_code’ =\> (property\_exists($object, ‘severity\_code’) ? $object-\>severity\_code : ‘’),  
$array\_key.‘\_date\_creation’ =\> (!empty($object-\>datec) ? dol\_print\_date($object-\>datec, ‘dayhour’) : ‘’),  
$array\_key.‘\_date\_close’ =\> (!empty($object-\>date\_close) ? dol\_print\_date($object-\>date\_close, ‘dayhour’) : ‘’),  
$array\_key.‘\_user\_assign’ =\> (property\_exists($object, ‘fk\_user\_assign’) ? $object-\>fk\_user\_assign : ‘’),  
$array\_key.‘\_category’ =\> (property\_exists($object, ‘category\_code’) ? $object-\>category\_code : ‘’),  
);

// Retrieve extrafields  
if (is\_array($object-\>array\_options) && count($object-\>array\_options)) {  
$object-\>fetch\_optionals();

$resarray = $this-\>fill\_substitutionarray\_with\_extrafields($object, $resarray, $extrafields, $array\_key, $outputlangs);  
}  
return $resarray;  
}

---

<div class="post-metadata">

**Author:** ![wiconter](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/w/97f17d/32.png) [@wiconter](https://www.dolibarr.org/forum/u/wiconter)\
**Post date:** [July 16, 2026, 9:52pm UTC](https://www.dolibarr.org/forum/t/ticket-labels-are-not-replaced-in-the-odt-file/30925/4 "2026-07-16T21:52:08Z")

</div>

hola, tengo el mismo problema, realice lo que indica, de agregar el codigo pero igual no me funciona me podria orientar un poco mas sobre el tema

---

<div class="post-metadata">

**Author:** ![ccabrera\_mex](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/c/7bcc69/32.png) [@ccabrera\_mex](https://www.dolibarr.org/forum/u/ccabrera_mex)\
**Post date:** [July 22, 2026, 4:39pm UTC](https://www.dolibarr.org/forum/t/ticket-labels-are-not-replaced-in-the-odt-file/30925/5 "2026-07-22T16:39:38Z")

</div>

Hola

¿Qué error te marca o que información te presenta?  
tu archivo doc\_generic\_ticket\_odt.modules.php, en que carpeta está y que contenido tiene?

---

<div class="post-metadata">

**Author:** ![wiconter](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/w/97f17d/32.png) [@wiconter](https://www.dolibarr.org/forum/u/wiconter)\
**Post date:** [July 24, 2026, 2:56pm UTC](https://www.dolibarr.org/forum/t/ticket-labels-are-not-replaced-in-the-odt-file/30925/6 "2026-07-24T14:56:58Z")

</div>

hola, gracias por contestar, no recuerdo el error, pero lo meti en geminis y me ayudo, hasta las imagenes adjuntas del ticket me las trae y las muestro

muchas gracias
