NEW #35700 : Throw an error when validating a propal, order, supplier with a product no more in sale/purchase… (#35709)

* Fix #35700 : Throw an error when validating a propal, order, supplier proposal, supplier order if some products doesn't have the good status (on sale, on buy)

* Fix #35700 : Throw an error when validating a propal, order, supplier proposal, supplier order if some products doesn't have the good status (on sale, on buy)

* Fix #35700 : Throw an error when validating a propal, order, supplier proposal, supplier order if some products doesn't have the good status (on sale, on buy)

* Fix #35700 : Throw an error when validating a propal, order, supplier proposal, supplier order if some products doesn't have the good status (on sale, on buy)

* Fix #35700 : Throw an error when validating a propal, order, supplier proposal, supplier order if some products doesn't have the good status (on sale, on buy)

* Update commonobject.class.php

* Refactor checkActiveProductInLines method

* Fix comment formatting in commonobject.class.php

* Update commonobject.class.php

---------

Co-authored-by: vmaury <vmaury@vmaury-Lafite-Pro-16-AMD>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
Vincent Maury
2025-10-18 11:19:31 +02:00
committed by GitHub
parent f0c61790eb
commit b28b94821f
7 changed files with 60 additions and 3 deletions

View File

@@ -529,7 +529,10 @@ class Commande extends CommonOrder
$this->error = 'ErrorWrongParameters';
return -1;
}
if (!getDolGlobalBool('ORDER_NOCHECK_ONSALE_PRODUCTS_ONVALID') && !$this->checkActiveProductInLines()) {
dol_syslog(get_class($this)."::valid checkActiveProductInLines ".$this->error, LOG_INFO);
return -1;
}
$now = dol_now();
$this->db->begin();