Skip to content
Snippets Groups Projects
Commit f11fcf6b authored by JF Aubert's avatar JF Aubert Committed by Arnold Moyaux
Browse files

[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
parent ea0e9ec0
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment