From 7a1199d6320186c9f96f5c6909969e428de9a773 Mon Sep 17 00:00:00 2001 From: Christopher Ormaza Date: Fri, 22 Sep 2023 07:44:17 -0500 Subject: [PATCH] [14.0][IMP] Added onchange to retrieve invoice address from partner selection --- rma_account/models/rma_order_line.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rma_account/models/rma_order_line.py b/rma_account/models/rma_order_line.py index 01535fe82..61c045108 100644 --- a/rma_account/models/rma_order_line.py +++ b/rma_account/models/rma_order_line.py @@ -15,6 +15,12 @@ def _default_invoice_address(self): return self.env["res.partner"].browse(partner_id) return self.env["res.partner"] + @api.onchange("partner_id") + def _onchange_invoice_address(self): + self.delivery_address_id = self.env["res.partner"].browse( + self.partner_id.address_get(["invoice"])["invoice"] + ) + @api.depends( "move_line_ids", "move_line_ids.move_id.state", "refund_policy", "type" )