[18.0][IMP] stock_mts_mto_rule: Several improvements - #2609
rousseldenis wants to merge 6 commits into
Conversation
As Odoo does it in stock core module and because running procurements one per one is suboptimal, group procurements run per action.
|
@florian-dacosta I've merged the migration PR: #2489 This in order to gather some improvements in this PR with better readability. As discussed in #2458, I've removed an unwanted constraint. @florian-dacosta @ypapouin I've refactored the way this behaves as I've observed great performances problems if procurements runs are not grouped. Do you see anything that I should pay attention to with that change ? Many thanks |
|
FYI, I passed from 500 seconds to 55 to run the scheduler with this change. 😄 |
|
@rousseldenis, I agree about the unneeded constraint , it's already removed on my side since it breaks existing workflows on our production database. About the procurement grouping, I didn't made any tests and I may be wrong about it, but I believe that it would lead to different results (that initial implementation): since all evaluation is done first and all processing is done after with your change, that means that when the first procurement run it will change stock quantities, quantities that would normally have an impact on the 2nd procurement (same product, etc.) that would adapt its split logic. If I'm right, this optimization could still be possible if products are not the same. |
@ypapouin Thanks for this. Indeed, I think I need to refine the logic in order to keep the procured quantity for each product by location. And do tests on that 😄 |
To improve performances, we grouped procurements runs. This has a drawback as if several procurement for the same location and for the same product are run together, the resulting moves will not take into account the preceding taken quantities. This fixes that.
…oduct, different locations
No description provided.