# Code for custom attributes in ODT templates

**URL:** <https://www.dolibarr.org/forum/t/code-for-custom-attributes-in-odt-templates/16391>\
**Category:** Using my Dolibarr\
**Created:** [February 8, 2018, 7:05pm UTC](https://www.dolibarr.org/forum/t/code-for-custom-attributes-in-odt-templates/16391 "2018-02-08T19:05:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![USN](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/usn/32/403_2.png) [@USN](https://www.dolibarr.org/forum/u/USN)\
**Post date:** [February 8, 2018, 7:05pm UTC](https://www.dolibarr.org/forum/t/code-for-custom-attributes-in-odt-templates/16391/1 "2018-02-08T19:05:44Z")

</div>

Hi again all…

my latest issue is with my ODT templates. Templates work fine for regular fields, but cannot get it to use my Complimentary attributes (object or lines). Whenever I use the field name:

{line\_options\_xxx}  
OR  
{object\_options\_xxx}

I get the actual text above printed on the document, it is not pulling anything from the DB. I tried to create both regular attributes and line attributes with no success. Should these field names be different now in 6.0.4 (they were created in 4.x.x)? Since it is actually spitting back the above code it leads me to believe it is no invoking it correctly, or am I mistaken?

We are not using a bunch of attributes (and have moved away from any 3rd party add-on) but need to place our internal Sales Order # on our packing lists.

Help would be greatly appreciated!

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Withheld](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/withheld/32/466_2.png) [@Withheld](https://www.dolibarr.org/forum/u/Withheld)\
**Post date:** [February 10, 2018, 10:46am UTC](https://www.dolibarr.org/forum/t/code-for-custom-attributes-in-odt-templates/16391/2 "2018-02-10T10:46:35Z")

</div>

Follow @ophion’s information in the link below and make sure to place those lines after the ‘write\_file’ line. Don’t forget to make a custom php template or backup the original before testing.

[www.dolibarr.org/t/solved-how-to-print-a-new-customfields/15213/2](http://www.dolibarr.org/t/solved-how-to-print-a-new-customfields/15213/2)

---

<div class="post-metadata">

**Author:** ![antoronson](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/antoronson/32/96_2.png) [@antoronson](https://www.dolibarr.org/forum/u/antoronson)\
**Post date:** [February 13, 2018, 10:04am UTC](https://www.dolibarr.org/forum/t/code-for-custom-attributes-in-odt-templates/16391/3 "2018-02-13T10:04:27Z")

</div>

Hi

The function {line\_options\_xxx} actually functions with Dolibarr 6.0.5. But the function {object\_options\_xxx} does not work. I am also trying to sort out.

The difference is, line function is used in recursive printing i.e., between [!-- BEGIN row.lines --]…[!-- END row.lines --], for the variables from complementary attributes (lines). and {object\_options\_xxx} is for variable from complementary attributes.

Thanks

---

<div class="post-metadata">

**Author:** ![USN](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/usn/32/403_2.png) [@USN](https://www.dolibarr.org/forum/u/USN)\
**Post date:** [February 14, 2018, 5:51pm UTC](https://www.dolibarr.org/forum/t/code-for-custom-attributes-in-odt-templates/16391/4 "2018-02-14T17:51:54Z")

</div>

Thanks for the input. I am heading to Europe for a few days, and will test when I return. The issue is that {line\_options\_xxx} OR {object\_options\_xxx} is showing up just as typed, and not returning any info from the DB. The first link/reply below seemed helpful, aside from it referenced the customFields module, and I stopped using that since it was causing errors in other places. But maybe need to adjust wherer the ‘write\_file’ line falls in the template.

I will report back next week to let everyone know what the issue was in case someone has similar problems.

Thanks!

---

<div class="post-metadata">

**Author:** ![Dido](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/d/87869e/32.png) [@Dido](https://www.dolibarr.org/forum/u/Dido)\
**Post date:** [February 15, 2018, 8:52am UTC](https://www.dolibarr.org/forum/t/code-for-custom-attributes-in-odt-templates/16391/5 "2018-02-15T08:52:05Z")

</div>

Hi All,

In fact I use 6.03 for long time and ODT Tags works ok. Now update to 6.05 and object\_options did not work with the templates which we have till now and works well?  
How to solve the issue?

---

<div class="post-metadata">

**Author:** ![Dido](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/d/87869e/32.png) [@Dido](https://www.dolibarr.org/forum/u/Dido)\
**Post date:** [February 15, 2018, 8:59am UTC](https://www.dolibarr.org/forum/t/code-for-custom-attributes-in-odt-templates/16391/6 "2018-02-15T08:59:32Z")

</div>

Ooops,  
I test it again.  
The issue is only when object is not validated.  
If object is validated - extra fields ODT {object\_options\_xxx} works ok.  
Tested only with Proposals

---

<div class="post-metadata">

**Author:** ![Dido](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/d/87869e/32.png) [@Dido](https://www.dolibarr.org/forum/u/Dido)\
**Post date:** [February 20, 2018, 11:37am UTC](https://www.dolibarr.org/forum/t/code-for-custom-attributes-in-odt-templates/16391/7 "2018-02-20T11:37:39Z")

</div>

Hello All,  
any suggestions on object\_options tags for 6.05 ? How we can fix it?
