From 7766d24070cd2f170388a877f14c6ec5e2b9ec5f Mon Sep 17 00:00:00 2001 From: MerlinGuillaume Date: Tue, 13 Dec 2022 09:59:53 +0000 Subject: [PATCH] [FIX] stock: delivery address for entire packages The delivery slip of a picking with an operation type where 'Move Entire Packages' is enabled doesn't print the delivery address Steps to reproduce: 1. Go to Settings > Inventory > Operations and enable 'Packages' 2. Go to Inventory > Configuration > Warehouse Management > Operations Type 3. Open operation type 'Delivery Orders' and enable 'Move Entire Packages' 4. Create a new transfer with operation type 'Delivery Orders', add a delivery address and a move and save 5. Mark as todo, put in pack and validate Solution: Always use the partner of the `move_lines` in the delivery address Apply the same logic to the address used in the picking operations report Problem: The delivery slip always uses the partner of `move_ids_without_package` but there might not be any if the picking uses packages opw-3091139 closes odoo/odoo#108465 X-original-commit: d113e0d7a5aa1c1f6bb933771cda4a3365361ba0 Signed-off-by: Tiffany Chang Signed-off-by: Guillaume Merlin (megu) --- addons/stock/models/stock_picking.py | 2 +- addons/stock/report/report_deliveryslip.xml | 2 +- addons/stock/report/report_stockpicking_operations.xml | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/stock/models/stock_picking.py b/addons/stock/models/stock_picking.py index cec308469a7..79d67ffb4ba 100644 --- a/addons/stock/models/stock_picking.py +++ b/addons/stock/models/stock_picking.py @@ -823,7 +823,7 @@ class Picking(models.Model): def should_print_delivery_address(self): self.ensure_one() - return self.move_ids_without_package and self.move_ids_without_package[0].partner_id and self._is_to_external_location() + return self.move_ids and self.move_ids[0].partner_id and self._is_to_external_location() def _is_to_external_location(self): self.ensure_one() diff --git a/addons/stock/report/report_deliveryslip.xml b/addons/stock/report/report_deliveryslip.xml index 801148c98c1..f51a7bc4f83 100644 --- a/addons/stock/report/report_deliveryslip.xml +++ b/addons/stock/report/report_deliveryslip.xml @@ -11,7 +11,7 @@
Delivery Address: -
-
+
Delivery Address: -
-
+
Warehouse Address: