Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions crm_compassion/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading