From 5450d64e40f64f8858abe8985f07385608619b48 Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Fri, 19 May 2023 16:03:10 +0200 Subject: [PATCH] [IMP] internal_stock_quant_package: Don't call unpack if not necessary As Odoo unpack() is calling the _merge_quants() function which can be bulky, don't call it if not necessary --- internal_stock_quant_package/models/stock_picking.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal_stock_quant_package/models/stock_picking.py b/internal_stock_quant_package/models/stock_picking.py index b630db2a973..f97d1dcc713 100644 --- a/internal_stock_quant_package/models/stock_picking.py +++ b/internal_stock_quant_package/models/stock_picking.py @@ -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() def _move_lines_clear_internal_result_packages(self): """