From d13a3a50e24b644c823f7863d32a26837a642b73 Mon Sep 17 00:00:00 2001 From: nicolas Date: Thu, 27 Oct 2022 11:31:12 -0300 Subject: [PATCH] [FIX] stock_request: fix access on act_window --- stock_request/models/stock_picking.py | 4 +++- stock_request/models/stock_request.py | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/stock_request/models/stock_picking.py b/stock_request/models/stock_picking.py index cfe03de7c..85ea9b092 100644 --- a/stock_request/models/stock_picking.py +++ b/stock_request/models/stock_picking.py @@ -26,7 +26,9 @@ class StockPicking(models.Model): """ :return dict: dictionary value for created view """ - action = self.env.ref("stock_request.action_stock_request_form").read()[0] + action = self.env["ir.actions.act_window"]._for_xml_id( + "stock_request.action_stock_request_form" + ) requests = self.mapped("stock_request_ids") if len(requests) > 1: diff --git a/stock_request/models/stock_request.py b/stock_request/models/stock_request.py index 3707071cd..dc8c00dc6 100644 --- a/stock_request/models/stock_request.py +++ b/stock_request/models/stock_request.py @@ -343,8 +343,9 @@ class StockRequest(models.Model): return True def action_view_transfer(self): - action = self.env.ref("stock.action_picking_tree_all").read()[0] - + action = self.env["ir.actions.act_window"]._for_xml_id( + "stock.action_picking_tree_all" + ) pickings = self.mapped("picking_ids") if len(pickings) > 1: action["domain"] = [("id", "in", pickings.ids)]