FIX: stock control condition in reception delete (#33952)

This commit is contained in:
Noé Cendrier
2025-04-24 01:47:43 +02:00
committed by GitHub
parent 76a89cad00
commit be3fae0275

View File

@@ -1060,7 +1060,7 @@ class Reception extends CommonObject
$this->db->begin();
// Stock control
if (isModEnabled('stock') && !getDolGlobalInt('STOCK_CALCULATE_ON_RECEPTION') && $this->statut > 0) {
if (isModEnabled('stock') && ((getDolGlobalInt('STOCK_CALCULATE_ON_RECEPTION') && $this->status > self::STATUS_DRAFT) || (getDolGlobalInt('STOCK_CALCULATE_ON_RECEPTION_CLOSE') && $this->status == self::STATUS_CLOSED))) {
require_once DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php";
$langs->load("agenda");