Skip to content

Commit

Permalink
Fix permission error using _for_xml_id
Browse files Browse the repository at this point in the history
  • Loading branch information
PNurm authored Sep 18, 2024
1 parent 6262025 commit 03aa7ef
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crm_phonecall/models/crm_lead.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{
Expand Down

0 comments on commit 03aa7ef

Please sign in to comment.