From cd63ae6637c4ff5cc0b5b27e3d8686c3840dde70 Mon Sep 17 00:00:00 2001 From: CarmenMiranda Date: Fri, 1 Jul 2022 23:59:33 +0000 Subject: [PATCH] [FIX] mrp: Access Error on MRP Stock Picking Type Now the way of access to an action is using the method `_for_xml_id` of the model `ir.actions.actions` and not reading the action itself because they need the access of the group "Administration/Settings" which not all the users have it, so we were having an error with users that have the permissions to see MRP Picking Types but they didn't have the group mentioned above. closes odoo/odoo#95312 X-original-commit: 1554fc9f8a98f4723b4f3cc1a8c0bd772c317ce5 Signed-off-by: Tiffany Chang --- addons/mrp/models/stock_picking.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/models/stock_picking.py b/addons/mrp/models/stock_picking.py index 9a31f3889a2..a1d4fdf2b70 100644 --- a/addons/mrp/models/stock_picking.py +++ b/addons/mrp/models/stock_picking.py @@ -48,7 +48,7 @@ class StockPickingType(models.Model): remaining.count_mo_late = False def get_mrp_stock_picking_action_picking_type(self): - action = self.env.ref('mrp.mrp_production_action_picking_deshboard').read()[0] + action = self.env["ir.actions.actions"]._for_xml_id('mrp.mrp_production_action_picking_deshboard') if self: action['display_name'] = self.display_name return action