From 69468464011ae098733de4960cd8528d4574fa4c 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..c6424557e 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.invoice_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" )