From 1d93159189055beb19ceec743b49905f3190cce4 Mon Sep 17 00:00:00 2001 From: Ylulu71D Date: Mon, 20 Jul 2026 15:45:45 +0200 Subject: [PATCH] [T2407] FIX : Correct opportunities count calculation --- crm_compassion/models/res_partner.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/crm_compassion/models/res_partner.py b/crm_compassion/models/res_partner.py index a93b67fc0..1aca718bd 100644 --- a/crm_compassion/models/res_partner.py +++ b/crm_compassion/models/res_partner.py @@ -61,21 +61,6 @@ def create_odoo_user(self): res = portal.action_apply() return res - def _compute_opportunity_count(self): - res = super()._compute_opportunity_count() - for partner in self: - operator = "child_of" if partner.is_company else "=" - # Using partner.ids[0] is a trick to avoid error with child_of - # when partner has a temporary NewId - partner.opportunity_count += self.env["crm.lead"].search_count( - [ - ("partner_id", operator, partner.ids[0]), - ("type", "=", "opportunity"), - ("active", "=", False), - ] - ) - return res - def log_call(self): """Prepare crm.phonecall creation.""" self.ensure_one()