Merge PR #306 into 14.0

Signed-off-by pedrobaeza
This commit is contained in:
OCA-git-bot
2022-09-19 15:12:50 +00:00
2 changed files with 3 additions and 7 deletions

View File

@@ -788,8 +788,6 @@ class Rma(models.Model):
def action_view_receipt(self):
"""Invoked when 'Receipt' smart button in rma form view is clicked."""
self.ensure_one()
# Force active_id to avoid issues when coming from smart buttons
# in other models
action = self.env["ir.actions.actions"]._for_xml_id(
"stock.action_picking_tree_all"
)
@@ -816,10 +814,8 @@ class Rma(models.Model):
def action_view_delivery(self):
"""Invoked when 'Delivery' smart button in rma form view is clicked."""
action = (
self.env.ref("stock.action_picking_tree_all")
.with_context(active_id=self.id)
.read()[0]
action = self.env["ir.actions.actions"]._for_xml_id(
"stock.action_picking_tree_all"
)
picking = self.delivery_move_ids.mapped("picking_id")
if len(picking) > 1:

View File

@@ -29,7 +29,7 @@ class StockPicking(models.Model):
def action_view_rma(self):
self.ensure_one()
action = self.sudo().env.ref("rma.rma_action").read()[0]
action = self.env["ir.actions.actions"]._for_xml_id("rma.rma_action")
rma = self.move_lines.mapped("rma_ids")
if len(rma) == 1:
action.update(