From 186547adb8dafcc955ab7b003af1bfbbb1dd31c0 Mon Sep 17 00:00:00 2001 From: AlexPForgeFlow Date: Mon, 19 Aug 2024 16:25:38 +0200 Subject: [PATCH 1/2] [16.0][FIX] rma_account: fiscal_position_id is a computed field In v16, fiscal_position_id is a computed field, so if we set up the field in the refund creation we are overriding the computed value --- rma_account/wizards/rma_refund.py | 1 - 1 file changed, 1 deletion(-) diff --git a/rma_account/wizards/rma_refund.py b/rma_account/wizards/rma_refund.py index c03d3895b..2eebfb545 100644 --- a/rma_account/wizards/rma_refund.py +++ b/rma_account/wizards/rma_refund.py @@ -167,7 +167,6 @@ def _prepare_refund(self, wizard, rma_line): "ref": ref, "move_type": "in_refund" if rma_line.type == "supplier" else "out_refund", "journal_id": journal.id, - "fiscal_position_id": rma_line.partner_id.property_account_position_id.id, "state": "draft", "currency_id": self._get_refund_currency(rma_line).id, "date": wizard.date, From ded375f7299af28c41e1c6b822973b1490676b34 Mon Sep 17 00:00:00 2001 From: AlexPForgeFlow Date: Tue, 20 Aug 2024 15:51:48 +0200 Subject: [PATCH 2/2] [16.0][IMP] rma_account: consider rma delivery address when creating a refund --- rma_account/wizards/rma_refund.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rma_account/wizards/rma_refund.py b/rma_account/wizards/rma_refund.py index 2eebfb545..296299867 100644 --- a/rma_account/wizards/rma_refund.py +++ b/rma_account/wizards/rma_refund.py @@ -172,6 +172,8 @@ def _prepare_refund(self, wizard, rma_line): "date": wizard.date, "invoice_date": wizard.date_invoice, "partner_id": rma_line.invoice_address_id.id or rma_line.partner_id.id, + "partner_shipping_id": rma_line.delivery_address_id.id + or rma_line.partner_id.id, "invoice_line_ids": [ (0, None, self.prepare_refund_line(item)) for item in self.item_ids ],