[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 <tic@odoo.com>
This commit is contained in:
CarmenMiranda
2022-07-05 13:53:46 +02:00
parent b288bf39df
commit cd63ae6637
+1 -1
View File
@@ -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