[performance] confirming a purchase order takes ages
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenERP new WMS |
New
|
Undecided
|
Unassigned |
Bug Description
It takes hours to confirm a purchase order with order lines which refer to some hundreds of procurements, thereby creating some hundreds of stock moves.
The bottleneck seems to be the fact that there are some function fields on stock.move (created by purchase, stock, delivery, stock_account - nothing fancy) that are evaluated each on its own. The attached patch fixes this by suppressing function field evaluation for the create call and evaluating them en bloc afterwards. This way, the confirmation needs only a minute compared to some hours.
In my opinion, there should be a bulk_create() function with the same signature as create() that does exactly this. I couldn't find anything like that in the apiculture branch, does it make sense to prepare a merge proposal for that?
Related branches
- OpenERP R&D Team: Pending requested
-
Diff: 29 lines (+13/-0)1 file modifiedpurchase/purchase.py (+13/-0)
- OpenERP R&D Team: Pending requested
-
Diff: 37 lines (+16/-5)1 file modifiedmrp/mrp.py (+16/-5)
PS: I think doing the same in procurements would also massively speed up the procurement process