Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: CRM

Entity: crm.lead

Compute Method: _compute_is_partner_visible

View 17.0
Inputs Method Outputs
  • type
  • partner_id
- """ When the crm.lead is of type 'lead', we don't want to display the "Customer" field on the form view
-         unless it's set (or debug mode).
- 
-         Indeed, most of the times leads will not have this information set, since when we assign a Customer we
-         usually convert the lead to an opportunity as well.
- 
-         This means that on the lead form, we don't want to display this field since it may be misleading for the
-         end user.
-         When it's set however, we want to display it, mainly because there are a few automatic synchronizations between
-         the lead and its partner (phone and email for examples), and this needs to be clear that modifying
-         one of those fields will in turn modify the linked partner."""
- is_debug_mode = self.user_has_groups('base.group_no_one')
- for lead in self:
-             lead.is_partner_visible = bool(lead.type == 'opportunity' or lead.partner_id or is_debug_mode)
  • is_partner_visible

Back to entity