FIX: #16476 version 2

This commit is contained in:
Guido Schratzer 2022-09-24 20:19:17 +03:00
parent 322d0955f2
commit 3517cdf1b4

View File

@ -1388,7 +1388,6 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) {
foreach ($toselect as $toselectid) {
$result = $objecttmp->fetch($toselectid);
if ($result > 0) {
$objecttmp->fetch_thirdparty(); //load lang from thirdparty
$outputlangs = $langs;
$newlang = '';
@ -1401,6 +1400,10 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) {
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($objecttmp->default_lang)) {
$newlang = $objecttmp->default_lang; // for thirdparty
}
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && empty($objecttmp->thirdparty)) { //load lang from thirdparty
$objecttmp->fetch_thirdparty();
$newlang = $objecttmp->thirdparty->default_lang; // for proposal, order, invoice, ...
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);