From 03aa7ef2bc0d644a3805abaff7f5215a748de578 Mon Sep 17 00:00:00 2001 From: PNurm <65661625+PNurm@users.noreply.github.com> Date: Wed, 18 Sep 2024 17:15:13 +0300 Subject: [PATCH] Fix permission error using _for_xml_id --- crm_phonecall/models/crm_lead.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crm_phonecall/models/crm_lead.py b/crm_phonecall/models/crm_lead.py index 8c4434b8294..ab2e255687f 100644 --- a/crm_phonecall/models/crm_lead.py +++ b/crm_phonecall/models/crm_lead.py @@ -25,8 +25,7 @@ def _compute_phonecall_count(self): def button_open_phonecall(self): self.ensure_one() - action = self.env.ref("crm_phonecall.crm_case_categ_phone_incoming0").sudo() - action_dict = action.read()[0] if action else {} + action_dict = self.env["ir.actions.actions"]._for_xml_id("crm_phonecall.crm_case_categ_phone_incoming0") action_dict["context"] = safe_eval(action_dict.get("context", "{}")) action_dict["context"].update( {