Merge pull request #26051 from Easya-Solutions/14.0_fix-proposal-card-fetch-thirdparty

FIX thirdparty object in proposal card is not loaded
This commit is contained in:
Laurent Destailleur 2023-09-28 23:00:50 +02:00 committed by GitHub
commit 9c00ddac24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1892,9 +1892,8 @@ if ($action == 'create') {
/*
* Show object in view mode
*/
$soc = new Societe($db);
$soc->fetch($object->socid);
$object->fetch_thirdparty();
$soc = $object->thirdparty;
$head = propal_prepare_head($object);
print dol_get_fiche_head($head, 'comm', $langs->trans('Proposal'), -1, 'propal');
@ -1993,9 +1992,9 @@ if ($action == 'create') {
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherProposals").'</a>)';
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$soc->getNomUrl(1, 'customer');
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $soc->id > 0) {
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$soc->id.'&search_societe='.urlencode($soc->name).'">'.$langs->trans("OtherProposals").'</a>)';
}
// Project
if (!empty($conf->projet->enabled)) {