Closed victoralmau closed 1 month ago
Hi @ernestotejeda, some modules you are maintaining are being modified, check this out!
We are losing here a lot of performance, as this applies to all sales order lines, no matter if with pack or not.
Aren't there any other option for this?
Changed so that it only applies when any line that is created is a pack.
But it still has the problem with large orders containing packs. You have to find another alternative. How it was done in previous versions? What is the difference now?
v15 code: https://github.com/OCA/product-pack/blob/15.0/sale_product_pack/models/sale_order_line.py#L79 After creating each of the lines, the extra lines of the pack were auto-created (if applicable).
Ping @pedrobaeza
Why don't you try to incorporate the pack lines to the dictionary vals list after each record, and call super with all of them, and then only returning those recordsets that are not pack lines? Do you understand me?
Why don't you try to incorporate the pack lines to the dictionary vals list after each record, and call super with all of them, and then only returning those recordsets that are not pack lines? Do you understand me?
Yes, I understand what you are saying but “it is not possible”. It would be to add to the dictionary the “extra lines” that are set in https://github.com/OCA/product-pack/blob/16.0/sale_product_pack/models/sale_order_line.py#L56 but those values are obtained precisely by taking as reference the “parent” line (sale.order.line
) already existing https://github.com/OCA/product-pack/blob/16.0/sale_product_pack/models/product_pack_line.py#L14.
What a great day to merge this nice PR. Let's do it! Prepared branch 16.0-ocabot-merge-pr-186-by-pedrobaeza-bump-patch, awaiting test results.
Congratulations, your PR was merged at 11d3fe3b764424d2b18dfeace081a424350c289a. Thanks a lot for contributing to OCA. ❤️
Respect the order of the lines to be added
Before
After
Please @pedrobaeza and @chienandalu can you review it?
@Tecnativa TT51380