2
0
forked from Wavyzz/dolibarr
This commit is contained in:
Clément
2025-04-24 15:37:30 +02:00
committed by GitHub
parent ea59ab8837
commit 585577d667

View File

@@ -1490,7 +1490,7 @@ class Expedition extends CommonObject
// Add a protection to refuse deleting if shipment has at least one delivery
$this->fetchObjectLinked($this->id, 'shipping', 0, 'delivery'); // Get deliveries linked to this shipment
if (count($this->linkedObjectsIds) > 0) {
if (isset($this->linkedObjectsIds['delivery']) && count($this->linkedObjectsIds['delivery']) > 0) {
$this->error = 'ErrorThereIsSomeDeliveries';
$error++;
}
@@ -1700,7 +1700,7 @@ class Expedition extends CommonObject
// Add a protection to refuse deleting if shipment has at least one delivery
$this->fetchObjectLinked($this->id, 'shipping', 0, 'delivery'); // Get deliveries linked to this shipment
if (count($this->linkedObjectsIds) > 0) {
if (isset($this->linkedObjectsIds['delivery']) && count($this->linkedObjectsIds['delivery']) > 0) {
$this->error = 'ErrorThereIsSomeDeliveries';
$error++;
}