FIX : allow setDraft on cancelled orders if ORDER_REOPEN_TO_DRAFT is set (#30396)

* Fix missing loading trans file

* FIX : allow setDraft on cancelled orders if ORDER_REOPEN_TO_DRAFT is set

---------

Co-authored-by: Laurent Destailleur <eldy@users.sourceforge.net>
Co-authored-by: Christophe Battarel <christophe@altairis.fr>
This commit is contained in:
Christophe Battarel 2024-07-16 21:54:04 +02:00 committed by GitHub
parent 82589285e7
commit 97b4093d22
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -643,7 +643,7 @@ class Commande extends CommonOrder
$error = 0;
// Protection
if ($this->statut <= self::STATUS_DRAFT) {
if ($this->statut <= self::STATUS_DRAFT && !getDolGlobalInt('ORDER_REOPEN_TO_DRAFT')) {
return 0;
}

View file

@ -2197,6 +2197,7 @@ if ($action == 'create') {
);
}
if (isModEnabled('supplier_invoice') && $object->status > 0 && $soc->fournisseur == 1) {
$langs->load("suppliers");
$arrayofcreatebutton[] = array(
'url' => '/fourn/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id,
'label' => $langs->trans('AddSupplierInvoice'),