Name: [IMP][16.0] mrp*: Improved speed when viewing production orders

State: Killed

PR State: merged

PR Author: Trinh Ngoc Hung

PR Author Email: ngochung207@gmail.com

PR: #1111

Committer: Roy Le

Committer Email: roy.le@viindoo.com

Commit: d2e590a9832ca02b7dbf801815bc9bf335e8f6ed

Description:

                                            [PERF] purchase_mrp: optimize purchase_order_count computation using
single SQL query

The previous approach used multiple ORM traversals and len(set(...))
logic in Python, which caused performance degradation on large datasets.

This PR improves the performance of the purchase_order_count computed
field on the production order by replacing the slow Python-level
iteration over stock moves with a single optimized SQL query. This
refactor ensures fast and reliable results even on databases with
thousands of stock moves and procurement groups.
                                            

Branch: 16.0

Instance ID: 0

Age: Not started

Up-time: Not finished