diff --git a/crm_phonecall/models/crm_lead.py b/crm_phonecall/models/crm_lead.py index da59612c6a4..f71bfb43e00 100644 --- a/crm_phonecall/models/crm_lead.py +++ b/crm_phonecall/models/crm_lead.py @@ -25,8 +25,9 @@ def _compute_phonecall_count(self): def button_open_phonecall(self): self.ensure_one() - action = self.env.ref("crm_phonecall.crm_case_categ_phone_incoming0") - action_dict = action.read()[0] if action else {} + action_dict = self.env["ir.actions.act_window"]._for_xml_id( + "crm_phonecall.crm_case_categ_phone_incoming0" + ) action_dict["context"] = safe_eval(action_dict.get("context", "{}")) action_dict["context"].update( {