-
- Downloads
[REF] mrp: split productions
There is 2 major issues with the production of multiple serials number - Performance issue - Duplicated code with classic backorder mechanism The performance issues exist since backorders were create one by one and `stock.move` and `stock.move.line` are always recomputed. They are not created in batch neither. _generate_backorders is removed and replace by _split_productions. The functionality are the same. Technicaly it does the maximum in batch, first it creates all the `mrp.production` then all the `stock.move` and finaly, it splits the existing `stock.move.line` among the new `stock.move` It means that the reservation is not recompute anymore during a backorder process and will remain the same than the splitted production order. Performance metrics (10 components): | 2 | 10 100 1000 before | 0.47s | 2.84s | 32.25s | 580.53s ----------------------------------------------- after | 0.13s | 0.36s | 2.60s | 35.17s task 2633369 Part-of: odoo/odoo#77254
Showing
- addons/mrp/models/mrp_production.py 192 additions, 172 deletionsaddons/mrp/models/mrp_production.py
- addons/mrp/models/stock_move.py 10 additions, 1 deletionaddons/mrp/models/stock_move.py
- addons/mrp/tests/__init__.py 1 addition, 0 deletionsaddons/mrp/tests/__init__.py
- addons/mrp/tests/test_order.py 0 additions, 104 deletionsaddons/mrp/tests/test_order.py
- addons/mrp/tests/test_performance.py 112 additions, 0 deletionsaddons/mrp/tests/test_performance.py
- addons/mrp/tests/test_smp.py 52 additions, 10 deletionsaddons/mrp/tests/test_smp.py
- addons/mrp/wizard/stock_assign_serial_numbers.py 21 additions, 3 deletionsaddons/mrp/wizard/stock_assign_serial_numbers.py
- addons/mrp/wizard/stock_assign_serial_numbers.xml 1 addition, 1 deletionaddons/mrp/wizard/stock_assign_serial_numbers.xml
- addons/mrp_subcontracting/models/mrp_production.py 1 addition, 1 deletionaddons/mrp_subcontracting/models/mrp_production.py
- addons/mrp_subcontracting/models/stock_picking.py 1 addition, 2 deletionsaddons/mrp_subcontracting/models/stock_picking.py
- addons/mrp_subcontracting/tests/test_subcontracting.py 1 addition, 1 deletionaddons/mrp_subcontracting/tests/test_subcontracting.py
- addons/stock/models/stock_move_line.py 1 addition, 1 deletionaddons/stock/models/stock_move_line.py
Loading
Please register or sign in to comment