[FIX] rma: Change code to get the correct rmas (move_ids.rma_ids)

This commit is contained in:
Víctor Martínez
2024-06-28 09:12:03 +02:00
parent fe25d9da43
commit 833acb2f16

View File

@@ -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,