Skip to content

Commit

Permalink
[IMP] internal_stock_quant_package: Don't call unpack if not necessary
Browse files Browse the repository at this point in the history
As Odoo unpack() is calling the _merge_quants() function which can be bulky,
don't call it if not necessary
  • Loading branch information
rousseldenis authored and lmignon committed May 3, 2024
1 parent 4a8b7a8 commit 53151c2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal_stock_quant_package/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def _empty_transferred_internal_packages(self):
)
packages = pickings.mapped("move_line_ids.package_id")
internal_packages = packages.filtered("is_internal")
internal_packages.unpack()
if internal_packages:
internal_packages.unpack()

Check warning on line 47 in internal_stock_quant_package/models/stock_picking.py

View check run for this annotation

Codecov / codecov/patch

internal_stock_quant_package/models/stock_picking.py#L47

Added line #L47 was not covered by tests

def _move_lines_clear_internal_result_packages(self):
"""
Expand Down

0 comments on commit 53151c2

Please sign in to comment.