Issue when print by odt file could not export contact information in Dolibarr 13

Hi All

After i upgrade from v12 to v13 , i get a new problem .
When i print to odt template , i could not see contact information .
Al like company name , contact full name ,contact fone number ,email are disapear .
Are there anyone know how to fix it ?

Hi

If anyone had same issue with propal and order , my quick solution is copy the folder " /htdocs/core/modules/propale " or " /htdocs/core/modules/commande " from dolibarr 12.0.4 to same place in your server .

I compared Dolibarr v12 and v13 and for proposals, you need only change line 338 in /htdocs/core/modules/propale from

v13
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {

to

v12
if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))

I was looking at the code for /htdocs/core/modules/propale and /htdocs/core/modules/commande.

It looks like $contactobject is being defined in both the if/else conditions, which will resolve the issue.

Code for /htdocs/core/modules/commande

// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
	// We can use the company of contact instead of thirdparty company
	if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
		$object->contact->fetch_thirdparty();
		$socobject = $object->contact->thirdparty;
		$contactobject = $object->contact;
	} else {
		$socobject = $object->thirdparty;
		// if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
		$contactobject = $object->contact;
	}
} else {
	$socobject = $object->thirdparty;
}

$contactobject = $object->contact; is what is needed. Missing in the if clause in v13.

Upgrading to Dolibarr v14 will resolve the substitions when generating ODTs.

1 Like

Hi

Thanks for your reply .

I have upgraded to 14.0.3 few months ago , and this issue is gone .