Skip to content

Commit

Permalink
Merge pull request #32542 from Al-thi/fix/stock-import
Browse files Browse the repository at this point in the history
FIX #21294 Stock import sql query
  • Loading branch information
eldy authored Jan 13, 2025
2 parents e1a47ed + b7cb799 commit a46c47c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion htdocs/core/modules/modStock.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ public function __construct($db)
);
$this->import_updatekeys_array[$r] = array('ps.fk_product'=>'Product', 'ps.fk_entrepot'=>"Warehouse");
$this->import_run_sql_after_array[$r] = array( // Because we may change data that are denormalized, we must update dernormalized data after.
'UPDATE '.MAIN_DB_PREFIX.'product as p SET p.stock = (SELECT SUM(ps.reel) FROM '.MAIN_DB_PREFIX.'product_stock ps WHERE ps.fk_product = p.rowid);'
'UPDATE '.MAIN_DB_PREFIX.'product as p SET stock = (SELECT SUM(ps.reel) FROM '.MAIN_DB_PREFIX.'product_stock ps WHERE ps.fk_product = p.rowid);'
);
}

Expand Down

0 comments on commit a46c47c

Please sign in to comment.