Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stock_reception_screen: fix perf issue when move are created
When moves are created, Odoo triggers the computation of related/computed fields that could be impacted by this change. To compute the quantities the previous code was triggering a SQL query on 'stock_move' without any clause to satisfy the 'product.stock_move_ids' One2many field: "SELECT id FROM stock_move WHERE product_id IN (...);", hammering PostgreSQL and increasing the time needed to create a move. By removing the dependencies on these quantity fields (that are depending on 'product.stock_move_ids' field), we avoid this huge query on the DB, speeding up the time required to create a move. This should not impact the users of the reception screen as these quantities are only displayed for information when scanning a received product.
- Loading branch information