Merge pull request #13714 from simnandez/11.0

FIX: Error update SQL into stock reception
This commit is contained in:
Laurent Destailleur 2020-04-23 18:31:11 +02:00 committed by GitHub
commit 922efaf49b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -515,6 +515,8 @@ class MouvementStock extends CommonObject
// Update PMP and denormalized value of stock qty at product level
if (! $error)
{
$newpmp = price2num($newpmp, 'MU');
// $sql = "UPDATE ".MAIN_DB_PREFIX."product SET pmp = ".$newpmp.", stock = ".$this->db->ifsql("stock IS NULL", 0, "stock") . " + ".$qty;
// $sql.= " WHERE rowid = ".$fk_product;
// Update pmp + denormalized fields because we change content of produt_stock. Warning: Do not use "SET p.stock", does not works with pgsql