Merge pull request #19236 from marc-dll/11.0_FIX_invoice_creation_blocked

FIX: URGENT: impossible to create an invoice
This commit is contained in:
Laurent Destailleur 2021-10-31 14:03:11 +01:00 committed by GitHub
commit ff696e0dad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 21 deletions

View File

@ -2756,15 +2756,6 @@ if (empty($reshook))
* View * View
*/ */
if (empty($object->id)) {
llxHeader();
$head = facture_prepare_head($object);
$langs->load('errors');
echo dol_get_fiche_head($head, 'compta', $langs->trans("InvoiceCustomer"), -1, 'bill'),
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
llxFooter();
exit;
}
$form = new Form($db); $form = new Form($db);
$formother = new FormOther($db); $formother = new FormOther($db);
@ -3679,6 +3670,15 @@ if ($action == 'create')
} }
elseif ($id > 0 || !empty($ref)) elseif ($id > 0 || !empty($ref))
{ {
if (empty($object->id)) {
llxHeader();
$langs->load('errors');
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound");
echo ' <a href="javascript:history.go(-1)">'.$langs->trans('GoBack').'</div>';
llxFooter();
exit;
}
/* /*
* Show object in view mode * Show object in view mode
*/ */

View File

@ -120,10 +120,8 @@ elseif ($action == 'deletecontact' && $user->rights->facture->creer)
if (empty($object->id)) { if (empty($object->id)) {
llxHeader(); llxHeader();
$head = facture_prepare_head($object);
$langs->load('errors'); $langs->load('errors');
echo dol_get_fiche_head($head, 'contact', $langs->trans("InvoiceCustomer"), -1, 'bill'), echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
llxFooter(); llxFooter();
exit; exit;
} }

View File

@ -87,10 +87,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
if (empty($object->id)) { if (empty($object->id)) {
llxHeader(); llxHeader();
$head = facture_prepare_head($object);
$langs->load('errors'); $langs->load('errors');
echo dol_get_fiche_head($head, 'documents', $langs->trans("InvoiceCustomer"), -1, 'bill'), echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
llxFooter(); llxFooter();
exit; exit;
} }

View File

@ -45,10 +45,8 @@ $ref = GETPOST("ref", 'alpha');
if (empty($object->id)) { if (empty($object->id)) {
llxHeader(); llxHeader();
$head = facture_prepare_head($object);
$langs->load('errors'); $langs->load('errors');
echo dol_get_fiche_head($head, 'info', $langs->trans("InvoiceCustomer"), -1, 'bill'), echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
llxFooter(); llxFooter();
exit; exit;
} }

View File

@ -66,10 +66,8 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include,
if (empty($object->id)) { if (empty($object->id)) {
llxHeader(); llxHeader();
$head = facture_prepare_head($object);
$langs->load('errors'); $langs->load('errors');
echo dol_get_fiche_head($head, 'note', $langs->trans("InvoiceCustomer"), -1, 'bill'), echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
llxFooter(); llxFooter();
exit; exit;
} }