Develop fix STOCK_MUST_BE_ENOUGH_FOR_(PROPAL|ORDER|INVOICE) (#33517)

* Manage STOCK_MUST_BE_ENOUGH_FOR_(PROPAL|ORDER|INVOICE) with new attribute stockable_product

* Use static properties for product types. Controle product type service.

* simpler condition for STOCK_MUST_BE_ENOUGH_FOR_PROPOSAL
This commit is contained in:
ThomasNgr-OpenDSI
2025-10-31 17:15:18 +01:00
committed by GitHub
parent 63ec276f5c
commit 1cd82c88cb
3 changed files with 5 additions and 5 deletions

View File

@@ -1673,7 +1673,7 @@ class Commande extends CommonOrder
$result = $product->fetch($fk_product);
$product_type = $product->type;
if (getDolGlobalString('STOCK_MUST_BE_ENOUGH_FOR_ORDER') && $product_type == 0) {
if (getDolGlobalString('STOCK_MUST_BE_ENOUGH_FOR_ORDER') && $product->isStockManaged()) {
// get real stock
$productChildrenNb = 0;
if (getDolGlobalInt('PRODUIT_SOUSPRODUITS')) {
@@ -3228,7 +3228,7 @@ class Commande extends CommonOrder
$result = $product->fetch($line->fk_product);
$product_type = $product->type;
if (getDolGlobalString('STOCK_MUST_BE_ENOUGH_FOR_ORDER') && $product_type == 0) {
if (getDolGlobalString('STOCK_MUST_BE_ENOUGH_FOR_ORDER') && $product->isStockManaged()) {
// get real stock
$productChildrenNb = 0;
if (getDolGlobalInt('PRODUIT_SOUSPRODUITS')) {