From 2040aead515708ec1f1edbe3b9e7f5c7954ab10e Mon Sep 17 00:00:00 2001 From: AlexPForgeFlow Date: Tue, 20 Aug 2024 10:46:04 +0200 Subject: [PATCH] [16.0][IMP] rma_account & rma_sale: fix delivery and invoice addresses --- rma_account/models/rma_order_line.py | 2 +- rma_account/wizards/rma_add_account_move.py | 2 +- rma_sale/models/rma_order_line.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rma_account/models/rma_order_line.py b/rma_account/models/rma_order_line.py index 74bca60d7..4fc2dfff8 100644 --- a/rma_account/models/rma_order_line.py +++ b/rma_account/models/rma_order_line.py @@ -211,7 +211,7 @@ def _prepare_rma_line_from_inv_line(self, line): line.date, round=False, ), - "delivery_address_id": line.move_id.partner_id.id, + "delivery_address_id": line.move_id.partner_shipping_id.id, "invoice_address_id": line.move_id.partner_id.id, "receipt_policy": operation.receipt_policy, "refund_policy": operation.refund_policy, diff --git a/rma_account/wizards/rma_add_account_move.py b/rma_account/wizards/rma_add_account_move.py index d4588f11c..137a311eb 100644 --- a/rma_account/wizards/rma_add_account_move.py +++ b/rma_account/wizards/rma_add_account_move.py @@ -89,7 +89,7 @@ def _prepare_rma_line_from_inv_line(self, line): line.date, round=False, ), - "delivery_address_id": line.move_id.partner_id.id, + "delivery_address_id": line.move_id.partner_shipping_id.id, "invoice_address_id": line.move_id.partner_id.id, "rma_id": self.rma_id.id, "receipt_policy": operation.receipt_policy, diff --git a/rma_sale/models/rma_order_line.py b/rma_sale/models/rma_order_line.py index 4f722a08b..86c9aff46 100644 --- a/rma_sale/models/rma_order_line.py +++ b/rma_sale/models/rma_order_line.py @@ -139,8 +139,8 @@ def _prepare_rma_line_from_sale_order_line(self, line): "uom_id": line.product_uom.id, "operation_id": operation.id, "product_qty": line.product_uom_qty, - "delivery_address_id": line.order_id.partner_id.id, - "invoice_address_id": line.order_id.partner_id.id, + "delivery_address_id": line.order_id.partner_shipping_id.id, + "invoice_address_id": line.order_id.partner_invoice_id.id, "price_unit": line.currency_id._convert( line.price_unit, line.currency_id,