From 833acb2f16de2defeb9f2dfc9591473b570471fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Fri, 28 Jun 2024 09:12:03 +0200 Subject: [PATCH] [FIX] rma: Change code to get the correct rmas (move_ids.rma_ids) --- rma/models/stock_picking.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rma/models/stock_picking.py b/rma/models/stock_picking.py index edbc0300..070cdabd 100644 --- a/rma/models/stock_picking.py +++ b/rma/models/stock_picking.py @@ -30,8 +30,8 @@ class StockPicking(models.Model): def action_view_rma(self): self.ensure_one() - action = self.sudo().env.ref("rma.rma_action").read()[0] - rma = self.move_ids.mapped("rma_ids") + action = self.env["ir.actions.act_window"]._for_xml_id("rma.rma_action") + rma = self.move_ids.rma_ids if len(rma) == 1: action.update( res_id=rma.id,