Welcome, Guest
Username: Password: Remember me
Check that your potential issue isn't already confirmed and fixed in the recent releases. A summary of all changes can be found in the Dolibarr Changelogs

TOPIC: Extra Fields in ODT

Extra Fields in ODT 2 months 4 days ago #37255

Hi everybody,

first of all, I´m a very newbie in Dolibarr and also not very good in PHP.

I want to create a report of my customers in the thirdparties ODT Template. I will give a overview about customer datas and needs (for that I created some extrafields), also about appointmens and projects with that contact. You can see the ODT in attachment.

File Attachment:

File Name: Bericht.odt
File Size: 18 KB

File Attachment:

File Name: Bericht18.pdf
File Size: 61 KB

The problem is, when I create the ODT with the ODT Modul, I only get results for the main tags, given by the systems. I don´t get results for the extrafields and even not for the projetcs and appointments, I only get the tags in the ODT. You can see the result in the pdf in attachment.

I searched the german and the english forums, but I don´t find the rigth solution. Even I don´t want to destroy something ;-).

I think I have to set the setting in one of the PHP Moduls to global, but I don´t know where and how. Or, do I have to do the Other personalized tags modul, like its writen here:

wiki.dolibarr.org/index.php/Create_an_ODT_document_template as its writen down there?

But then I don´t know what values I need to but in the PHP. Could anybody help my with that? I would be very thankful!!!!

I Use Dolibarr 9.0.3.

Thanks to everyone for your help!

If you want to add a field that is not predefined, this is the solution:

Create a file into the location:

Inside this file, just write one function like this:
/** Function called to complete substitution array (before generating on ODT, or a personalized email)
* functions xxx_completesubstitutionarray are called by make_substitutions() if file
* is inside directory htdocs/core/substitutions
* @param array $substitutionarray Array with substitution key=>val
* @param Translate $langs Output langs
* @param Object $object Object to use to get values
* @return void The entry parameter $substitutionarray is modified
function mymodule_completesubstitutionarray(&$substitutionarray,$langs,$object)
global $conf,$db;

$myvalue='Put here calculated value to insert';
Last Edit: 2 months 4 days ago by ksar. Reason: insert attachement
The administrator has disabled public write access.

Extra Fields in ODT 2 months 4 days ago #37258

  • ksar
  • ksar's Avatar
  • Moderator
  • Posts: 289
  • Thank you received: 77
  • Karma: 12

A lot of questions in one topic!

First thing that you need to understand is that if you are generating the thiparty ODT, you will not have access to Project or tasks !
You will have in the ODT only the phirdparty tings.

Regarding the compagny extrafields could you share your configuration of it ?

What you are trying to do it is a al in one document that would need access to a lot of differents modules (thirparty/project/etc..) that would require and external module.
If you would like to do, you need first to follow that : wiki.dolibarr.org/index.php/Module_development
Then you can load your aditional substitutions
The administrator has disabled public write access.
The following user(s) said Thank You: Chris_Meyer

Extra Fields in ODT 2 months 4 days ago #37265

Thank you for your reply!!! : :cheer:

Ok, than I will read me into this, that should work with a little time ;)

In attachment you can see the configuration of the extra fields. Maybe I did something wrong, thats possible!

But first of all thank you very much! I became a bit desperately about it this week!


Last Edit: 2 months 3 days ago by ksar.
The administrator has disabled public write access.
Time to create page: 0.134 seconds