Repository
odoo/odoo · module folder
Module version
1.9
Category
Sales/CRM
Folder size
11.15 MB
License
LGPL-3
Application
Yes
Auto-installable
No
Website
https://www.odoo.com/app/crm
Last tracking update
2026-08-15 22:44:16
Authors
Odoo S.A.
Maintainers
Odoo S.A.
Committers
Xavier Morel, Raphael Collet, Thibault Delavallée, Odoo Translation Bot, Joren Van Onder, Aaron Bohy, Christophe Monniez, Jorge Pinna Puissant, Julien Castiaux, Romeo Fragomeli, Adrien Dieudonné, Sébastien Theys, Julien Mougenot, std-odoo, Rémy Voet (ryv), Tiffany Chang (tic), Gorash, Mathieu Duckerts-Antoine, Pierre Paridans, William Braeckman, Miquel Raïch, Didier (did), luvi, Hubert Van De Walle, Renaud Thiry, Julien Banken, Louis Wicket (wil), alsh-odoo, Adrien Widart (awt), Maximilien (malb), Victor Piryns (pivi), Mahamadasif Ansari, amdi-odoo, Gauthier Wala (gawa), Dylan Kiss (dyki), Xavier Bol (xbo), Noe Antoine, Moises Lopez - https://www.vauxoo.com/, omra-odoo, Zelong Lin, sesn-odoo, maad-odoo, vava-odoo, Julien Carion (juca), jobl, adsh-odoo, Martin Trigaux (mat), Lopes Marc (loma), nihp-odoo, Shaan Thakkar (THSH), guce, yagp-odoo, Pierre Pulinckx (PIPU), Victor Miguel Armenta Carrillo, sben-odoo, elhayyany, Pierre Lamotte (pila), Pierre Pulinckx, Bastien PIERRE, zel-odoo, Vincent Sevestre, Krzysztof Magusiak (krma), Ajit Singh, defl, MAGREMENT, ramh, path-odoo, damrOdoo, Mohamed Barakat, saurabh, Kadam Darji, ELCO, chpa-odoo, Romain ROSANO (rros)
Odoo dependencies
Python dependencies
None
System dependencies
None
Required by
crm_claim, crm_event, crm_industry, crm_lead_code, crm_lead_currency, crm_lead_to_task, crm_lead_vat, crm_livechat, crm_location, crm_lost_reason_required, crm_mail_plugin, crm_operating_unit, crm_partner_assign, crm_partner_company_group, crm_phonecall, crm_project_create, crm_project_task, crm_sms, crm_stage_probability, crm_timesheet, crm_won_restrict_per_stage, event_crm, fieldservice_crm, iap_crm, l10n_br_crm, marketing_crm_partner, mass_mailing_crm, partnership, pms_crm, product_sale_team, sale_crm, sale_order_tag, srm, survey_crm, survey_crm_generation, test_crm_full, test_discuss_full, test_main_flows, website_crm, website_crm_partner_assign, website_crm_sms
Description

Code Analysis

Views touched (57)
XML IDNameModelTypeStatus
crm_action_helper crm action helper ir.ui.view qweb New
crm_activity_report_view_graph crm.activity.report.graph crm.activity.report graph New
crm_activity_report_view_pivot crm.activity.report.pivot crm.activity.report pivot New
crm_activity_report_view_search crm.activity.report.search crm.activity.report search New
crm_activity_report_view_tree crm.activity.report.list crm.activity.report list New
crm_case_calendar_view_leads crm.lead.calendar.lead crm.lead calendar New
crm_case_kanban_view_leads crm.lead.kanban.lead crm.lead kanban New
crm_case_tree_view_leads crm.lead.list.lead crm.lead list New
crm_case_tree_view_oppor crm.lead.list.opportunity crm.lead list New
crm_lead_lost_view_form crm.lead.lost.form crm.lead.lost form New
crm_lead_merge_summary crm_lead_merge_summary ir.ui.view qweb New
crm_lead_pls_update_view_form crm.lead.pls.update.view.form crm.lead.pls.update form New
crm_lead_stage_search Stage - Search crm.stage search New
crm_lead_view_activity crm.lead.view.activity crm.lead activity New
crm_lead_view_form crm.lead.form crm.lead form New
crm_lead_view_graph crm.lead.view.graph crm.lead graph New
crm_lead_view_graph_forecast crm.lead.view.graph.forecast crm.lead graph New
crm_lead_view_kanban_forecast crm.lead.view.kanban.forecast crm.lead kanban Inherits crm.crm_case_kanban_view_leads
crm_lead_view_list_activities crm.lead.list.activities crm.lead list Inherits crm.crm_case_tree_view_oppor
crm_lead_view_pivot crm.lead.view.pivot crm.lead pivot New
crm_lead_view_pivot_forecast crm.lead.view.pivot.forecast crm.lead pivot New
crm_lead_view_search_forecast crm.lead.view.search.forecast crm.lead search Inherits crm.view_crm_case_opportunities_filter
crm_lead_view_tree_forecast crm.lead.view.list.forecast crm.lead list Inherits crm.crm_case_tree_view_oppor
crm_lead_view_tree_opportunity_reporting crm.lead.list.opportunity.reporting crm.lead list Inherits crm.crm_case_tree_view_oppor
crm_lead_view_tree_reporting crm.lead.list.lead.reporting crm.lead list Inherits crm.crm_case_tree_view_leads
crm_lost_reason_view_form crm.lost.reason.form crm.lost.reason form New
crm_lost_reason_view_search crm.lost.reason.view.search crm.lost.reason search New
crm_lost_reason_view_tree crm.lost.reason.list crm.lost.reason list New
crm_opportunity_report_view_graph crm.opportunity.report.graph crm.lead graph New
crm_opportunity_report_view_graph_lead crm.opportunity.report.graph.lead crm.lead graph New
crm_opportunity_report_view_pivot crm.opportunity.report.pivot crm.lead pivot New
crm_opportunity_report_view_pivot_lead crm.opportunity.report.view.pivot.lead crm.lead pivot New
crm_opportunity_report_view_search crm.lead.search crm.lead search New
crm_recurring_plan_view_search crm.recurring.plan.view.search crm.recurring.plan search New
crm_recurring_plan_view_tree crm.recurring.plan.view.list crm.recurring.plan list New
crm_stage_form crm.stage.form crm.stage form New
crm_stage_tree crm.stage.list crm.stage list New
crm_team_member_view_form crm.team.member.view.form.inherit.crm crm.team.member form Inherits sales_team.crm_team_member_view_form
crm_team_member_view_kanban crm.team.member.view.kanban.inherit.crm crm.team.member kanban Inherits sales_team.crm_team_member_view_kanban
crm_team_member_view_tree crm.team.member.view.list crm.team.member list Inherits sales_team.crm_team_member_view_tree
crm_team_view_kanban_dashboard crm.team.view.kanban.dashboard.inherit.crm crm.team kanban Inherits sales_team.crm_team_view_kanban_dashboard
crm_team_view_tree crm.team.list.inherit.crm crm.team list Inherits sales_team.crm_team_view_tree
digest_digest_view_form digest.digest.view.form.inherit.crm.lead digest.digest form Inherits digest.digest_digest_view_form
merge_opportunity_form crm.merge.opportunity.form crm.merge.opportunity form New
quick_create_opportunity_form crm.lead.form.quick_create crm.lead form New
res_config_settings_view_form res.config.settings.view.form.inherit.crm res.config.settings form Inherits base.res_config_settings_view_form
sales_team_form_view_in_crm crm.team.form.inherit crm.team form Inherits sales_team.crm_team_view_form
utm_campaign_view_form utm.campaign.view.form utm.campaign form Inherits utm.utm_campaign_view_form
utm_campaign_view_kanban utm.campaign.view.kanban utm.campaign kanban Inherits utm.utm_campaign_view_kanban
view_crm_case_leads_filter crm.lead.search.lead crm.lead search New
view_crm_case_my_activities_filter crm.lead.search.myactivities crm.lead search Inherits crm.view_crm_case_leads_filter
view_crm_case_opportunities_filter crm.lead.search.opportunity crm.lead search New
view_crm_lead2opportunity_partner crm.lead2opportunity.partner.form crm.lead2opportunity.partner form New
view_crm_lead2opportunity_partner_mass crm.lead2opportunity.partner.mass.form crm.lead2opportunity.partner.mass form New
view_crm_lead_kanban crm.lead.kanban crm.lead kanban New
view_crm_meeting_search calendar.event.form.inherit calendar.event form Inherits calendar.view_calendar_event_search
view_partners_form_crm1 view.res.partner.form.crm.inherited1 res.partner form Inherits base.view_partner_form
HTTP endpoints (3)
Route(s)HandlerAuthTypeMethodsFlags
/lead/case_mark_lost CrmController.crm_lead_case_mark_lost user http GET
/lead/case_mark_won CrmController.crm_lead_case_mark_won user http GET
/lead/convert CrmController.crm_lead_convert user http GET
Models touched (22)

New fields (1)
  • opportunity_id Many2one → crm.lead
    domain="[('type', '=', 'opportunity')]" index=True ondelete='set null' args: 'crm.lead', 'Opportunity'
Public methods (2)
  • create(self, vals_list)
    @api.model_create_multi
  • default_get(self, fields)
    @api.model

New fields (20)
  • active Boolean
    readonly=True args: 'Active'
  • author_id Many2one → res.partner
    readonly=True args: 'res.partner', 'Assigned To'
  • body Html
    readonly=True args: 'Activity Description'
  • company_id Many2one → res.company
    readonly=True args: 'res.company', 'Company'
  • country_id Many2one → res.country
    readonly=True args: 'res.country', 'Country'
  • date Datetime
    readonly=True args: 'Completion Date'
  • date_closed Datetime
    readonly=True args: 'Closed Date'
  • date_conversion Datetime
    readonly=True args: 'Conversion Date'
  • date_deadline Date
    readonly=True args: 'Expected Closing'
  • lead_create_date Datetime
    readonly=True args: 'Creation Date'
  • lead_id Many2one → crm.lead
    readonly=True args: 'crm.lead', 'Opportunity'
  • lead_type Selection
    help='Type is used to separate Leads and Opportunities' selection=[('lead', 'Lead'), ('opportunity', 'Opportunity')] string='Type'
  • mail_activity_type_id Many2one → mail.activity.type
    readonly=True args: 'mail.activity.type', 'Activity Type'
  • partner_id Many2one → res.partner
    readonly=True args: 'res.partner', 'Customer'
  • stage_id Many2one → crm.stage
    readonly=True args: 'crm.stage', 'Stage'
  • subtype_id Many2one → mail.message.subtype
    readonly=True args: 'mail.message.subtype', 'Subtype'
  • tag_ids Many2many
    readonly=True related='lead_id.tag_ids'
  • team_id Many2one → crm.team
    readonly=True args: 'crm.team', 'Sales Team'
  • user_id Many2one → res.users
    readonly=True args: 'res.users', 'Salesperson'
  • won_status Selection
    readonly=True string='Is Won' args: [('won', 'Won'), ('lost', 'Lost'), ('pending', 'Pending')]
Public methods (1)
  • init(self)

New fields (70)
  • active Boolean
    default=True tracking=72 args: 'Active'
  • automated_probability Float
    compute='_compute_probabilities' readonly=True store=True args: 'Automated Probability'
  • calendar_event_ids One2many → calendar.event
    string='Meetings' args: 'calendar.event', 'opportunity_id'
  • campaign_id Many2one
    ondelete='set null'
  • city Char
    compute='_compute_partner_address_values' readonly=False store=True args: 'City'
  • color Integer
    default=0 args: 'Color Index'
  • commercial_partner_id Many2one → res.partner
    compute='_compute_commercial_partner_id' domain="[('is_company', '=', True)]" readonly=False store=False string='Customer Company' args: 'res.partner'
  • company_currency Many2one → res.currency
    compute='_compute_company_currency' compute_sudo=True string='Currency' args: 'res.currency'
  • company_id Many2one → res.company
    compute='_compute_company_id' index=True readonly=False store=True string='Company' args: 'res.company'
  • contact_name Char
    compute='_compute_contact_name' index='trigram' readonly=False store=True tracking=30 args: 'Contact Name'
  • country_id Many2one → res.country
    compute='_compute_partner_address_values' readonly=False store=True string='Country' args: 'res.country'
  • date_automation_last Datetime
    readonly=True args: 'Last Action'
  • date_closed Datetime
    copy=False readonly=True args: 'Closed Date'
  • date_conversion Datetime
    readonly=True args: 'Conversion Date'
  • date_deadline Date
    help='Estimate of the date on which the opportunity will be won.' args: 'Expected Closing'
  • date_last_stage_update Datetime
    compute='_compute_date_last_stage_update' index=True readonly=True store=True args: 'Last Stage Update'
  • date_open Datetime
    compute='_compute_date_open' readonly=True store=True args: 'Assignment Date'
  • day_close Float
    compute='_compute_day_close' store=True args: 'Days to Close'
  • day_open Float
    compute='_compute_day_open' store=True args: 'Days to Assign'
  • description Html
    args: 'Notes'
  • duplicate_lead_count Integer
    compute='_compute_potential_lead_duplicates' compute_sudo=True string='Potential Duplicate Lead Count'
  • duplicate_lead_ids Many2many → crm.lead
    compute='_compute_potential_lead_duplicates' compute_sudo=True context={'active_test': False} string='Potential Duplicate Lead' args: 'crm.lead'
  • email_domain_criterion Char
    compute='_compute_email_domain_criterion' index='btree_not_null' store=True string='Email Domain Criterion'
  • email_from Char
    compute='_compute_email_from' index='trigram' inverse='_inverse_email_from' readonly=False store=True tracking=40 args: 'Email'
  • email_normalized Char
    index='trigram'
  • email_state Selection
    compute='_compute_email_state' store=True string='Email Quality' args: [('correct', 'Correct'), ('incorrect', 'Incorrect')]
  • expected_revenue Monetary
    currency_field='company_currency' default=0.0 tracking=True args: 'Expected Revenue'
  • function Char
    compute='_compute_function' readonly=False store=True args: 'Job Position'
  • is_automated_probability Boolean
    compute='_compute_is_automated_probability' args: 'Is automated probability?'
  • is_partner_visible Boolean
    compute='_compute_is_partner_visible' args: 'Is Partner Visible'
  • lang_active_count Integer
    compute='_compute_lang_active_count'
  • lang_code Char
    related='lang_id.code'
  • lang_id Many2one → res.lang
    compute='_compute_lang_id' readonly=False store=True string='Language' args: 'res.lang'
  • lead_properties Properties
    copy=True definition='team_id.lead_properties_definition' args: 'Properties'
  • lost_reason_id Many2one → crm.lost.reason
    index=True ondelete='restrict' string='Lost Reason' tracking=71 args: 'crm.lost.reason'
  • medium_id Many2one
    ondelete='set null'
  • meeting_display_date Date
    compute='_compute_meeting_display'
  • meeting_display_label Char
    compute='_compute_meeting_display'
  • name Char
    compute='_compute_name' index='trigram' readonly=False required=True store=True args: 'Opportunity'
  • partner_email_update Boolean
    compute='_compute_partner_email_update' args: 'Partner Email will Update'
  • partner_id Many2one → res.partner
    check_company=True help='Linked partner (optional). Usually created when converting the lead. You can find a partner by its Name, TIN, Email or Internal Reference.' index=True string='Contact' tracking=10 args: 'res.partner'
  • partner_is_blacklisted Boolean
    readonly=True related='partner_id.is_blacklisted' args: 'Partner is blacklisted'
  • partner_name Char
    compute='_compute_partner_name' help='The name of the future partner company that will be created while converting the lead into opportunity' index='trigram' readonly=False store=True tracking=20 args: 'Company Name'
  • partner_phone_update Boolean
    compute='_compute_partner_phone_update' args: 'Partner Phone will Update'
  • phone Char
    compute='_compute_phone' inverse='_inverse_phone' readonly=False store=True tracking=50 args: 'Phone'
  • phone_sanitized Char
    index='btree_not_null'
  • phone_state Selection
    compute='_compute_phone_state' store=True string='Phone Quality' args: [('correct', 'Correct'), ('incorrect', 'Incorrect')]
  • priority Selection
    default=<expr> index=True string='Priority' args: crm_stage.AVAILABLE_PRIORITIES
  • probability Float
    aggregator='avg' compute='_compute_probabilities' copy=False readonly=False store=True args: 'Probability'
  • prorated_revenue Monetary
    compute='_compute_prorated_revenue' currency_field='company_currency' store=True args: 'Prorated Revenue'
  • recurring_plan Many2one → crm.recurring.plan
    string='Recurring Plan' args: 'crm.recurring.plan'
  • recurring_revenue Monetary
    currency_field='company_currency' default=0.0 tracking=True args: 'Recurring Revenues'
  • recurring_revenue_monthly Monetary
    compute='_compute_recurring_revenue_monthly' currency_field='company_currency' store=True args: 'Expected MRR'
  • recurring_revenue_monthly_prorated Monetary
    compute='_compute_recurring_revenue_monthly_prorated' currency_field='company_currency' store=True args: 'Prorated MRR'
  • recurring_revenue_prorated Monetary
    compute='_compute_recurring_revenue_prorated' currency_field='company_currency' store=True args: 'Prorated Recurring Revenues'
  • referred Char
    args: 'Referred By'
  • source_id Many2one
    ondelete='set null'
  • stage_id Many2one → crm.stage
    compute='_compute_stage_id' copy=False domain="['|', ('team_ids', '=', False), ('team_ids', 'in', team_id)]" group_expand='_read_group_stage_ids' index=True ondelete='restrict' readonly=False store=True string='Stage' tracking=True args: 'crm.stage'
  • stage_id_color Integer
    export_string_translation=False related='stage_id.color' string='Stage Color'
  • state_id Many2one → res.country.state
    compute='_compute_partner_address_values' domain="[('country_id', '=?', country_id)]" readonly=False store=True string='State' args: 'res.country.state'
  • street Char
    compute='_compute_partner_address_values' readonly=False store=True args: 'Street'
  • street2 Char
    compute='_compute_partner_address_values' readonly=False store=True args: 'Street2'
  • tag_ids Many2many → crm.tag
    help='Classify and analyze your lead/opportunity categories like: Training, Service' string='Tags' args: 'crm.tag', 'crm_tag_rel', 'lead_id', 'tag_id'
  • team_id Many2one → crm.team
    check_company=True compute='_compute_team_id' index=True ondelete='set null' precompute=True readonly=False store=True string='Sales Team' tracking=True args: 'crm.team'
  • type Selection
    default=<expr> index=True required=True tracking=15 args: [('lead', 'Lead'), ('opportunity', 'Opportunity')]
  • user_company_ids Many2many → res.company
    compute='_compute_user_company_ids' help='UX: Limit to lead company or all if no company' args: 'res.company'
  • user_id Many2one → res.users
    check_company=True default=<expr> domain="[('share', '=', False)]" index=True string='Salesperson' tracking=True args: 'res.users'
  • website Char
    compute='_compute_website' help='Website of the contact' readonly=False store=True args: 'Website'
  • won_status Selection
    compute='_compute_won_status' store=True string='Won/Lost' tracking=70 args: [('won', 'Won'), ('lost', 'Lost'), ('pending', 'Pending')]
  • zip Char
    change_default=True compute='_compute_partner_address_values' readonly=False store=True args: 'Zip'
Public methods (23)
  • action_reschedule_meeting(self)
  • action_restore(self)
    Restoring a lost lead means that it should go back to its normal life cycle. This should reactivate the lead but also force the recompute of its probability, for the stage where the lead is currently at. During toggle_active, when reactivating a lost lead,only the automated probability will be recomputed, because the probability is not automated anymore. Restore will reset this automation.
  • action_schedule_meeting(self, smart_calendar=True)
    Open meeting's calendar view to schedule meeting on current opportunity. :param bool smart_calendar: to set to False if the view should not try to choose relevant mode and initial date for calendar view, see ``_get_opportunity_meeting_view_parameters`` :returns: dictionary value for created Meeting view :rtype: dict
  • action_set_automated_probability(self)
    Update the automated probability and align probability to that value
  • action_set_lost(self, **additional_values)
    Lost semantic: probability = 0 AND active = False
  • action_set_won(self)
    Won semantic: stage.is_won (AND probability = 100 but implied)
  • action_set_won_rainbowman(self)
  • action_show_potential_duplicates(self)
    Open kanban view to display duplicate leads or opportunity. :return dict: dictionary value for created kanban view
  • action_unarchive(self)
    When re-activating, force update probability for both leads and opportunities. Note that archiving triggers nothing more, as a lead can be archived and not lost.
  • convert_opportunity(self, partner, user_ids=False, team_id=False)
  • copy_data(self, default=None)
  • create(self, vals_list)
    @api.model_create_multi
  • get_empty_list_help(self, help_message)
    @api.model
    This method returns the action helpers for the leads. If help is already provided on the action, the same is returned. Otherwise, we build the help message which contains the alias responsible for creating the lead (if available) and return it.
  • get_import_templates(self)
    @api.model
  • get_rainbowman_message(self)
  • log_meeting(self, meeting)
    Log the meeting info with a link to it in the chatter :param record meeting: the meeting we want to log
  • merge_opportunity(self, user_id=False, team_id=False, auto_unlink=True)
    Merge opportunities in one. Different cases of merge: - merge leads together = 1 new lead - merge at least 1 opp with anything else (lead or opp) = 1 new opp The resulting lead/opportunity will be the most important one (based on its confidence level) updated with values from other opportunities to merge. :param user_id: the id of the saleperson. If not given, will be determined by :meth:`_merge_data`. :param team_id: the id of the Sales Team. If not given, will be determined by :meth:`_merge_data`. :returns: crm.lead record resulting of th merge
  • message_new(self, msg_dict, custom_values=None)
    @api.model
  • prepare_pls_tooltip_data(self)
    Compute and return all necessary information to render CrmPlsTooltip, displayed when pressing the small AI button, located next to the label of probability when automated, in the crm.lead form view. This method first replaces ids with display names of relational fields before returning data, then also recomputes probabilities and writes them on self. :returns: :: { low_3_data: list of field-value couples for lowest 3 criterions, lowest first probability: numerical value, used for display on tooltip team_name: string, name of lead team if any top_3_data: list of field-value couples for top 3 criterions, highest first } :rtype: dict
  • redirect_lead_opportunity_view(self)
  • search_fetch(self, domain, field_names=None, offset=0, limit=None, order=None)
    @api.model
    Override to support ordering on my_activity_date_deadline. Ordering through web client calls search_read() with an order parameter set. Method search_read() then calls search_fetch(). Here we override search_fetch() to intercept a search with an order on field my_activity_date_deadline. In that case we do the search in two steps. First step: fill with deadline-based results * Perform a read_group on my activities to get a mapping lead_id / deadline Remember date_deadline is required, we always have a value for it. Only the earliest deadline per lead is kept. * Search leads linked to those activities that also match the asked domain and order from the original search request. * Results of that search will be at the top of returned results. Use limit None because we have to search all leads linked to activities as ordering on deadline is done in post processing. * Reorder them according to deadline asc or desc depending on original search ordering. Finally take only a subset of those leads to fill with results matching asked offset / limit. Second step: fill with other results. If first step does not gives results enough to match offset and limit parameters we fill with a search on other leads. We keep the asked domain and ordering while filtering out already scanned leads to keep a coherent results. All other search and search_read are left untouched by this override to avoid side effects. Search_count is not affected by this override.
  • unlink(self)
    Update meetings when removing opportunities, otherwise you have a link to a record that does not lead anywhere.
  • write(self, vals)

New fields (3)
  • lead_ids Many2many → crm.lead
    context={'active_test': False} string='Leads' args: 'crm.lead'
  • lost_feedback Html
    sanitize=True args: 'Closing Note'
  • lost_reason_id Many2one → crm.lost.reason
    args: 'crm.lost.reason', 'Lost Reason'
Public methods (1)
  • action_lost_reason_apply(self)
    Mark lead as lost and apply the loss reason

New fields (2)
  • pls_fields Many2many → crm.lead.scoring.frequency.field
    default=_get_default_pls_fields args: 'crm.lead.scoring.frequency.field'
  • pls_start_date Date
    default=_get_default_pls_start_date required=True
Public methods (1)
  • action_update_crm_lead_probabilities(self)

New fields (5)
  • lost_count Float
    digits=(16, 1) args: 'Lost Count'
  • team_id Many2one → crm.team
    ondelete='cascade' args: 'crm.team', 'Sales Team'
  • value Char
    args: 'Value'
  • variable Char
    index=True args: 'Variable'
  • won_count Float
    digits=(16, 1) args: 'Won Count'
Public methods (0)

No public methods.

New fields (3)
  • color Integer
    default=_get_default_color args: 'Color'
  • field_id Many2one → ir.model.fields
    domain=[('model_id.model', '=', 'crm.lead')] ondelete='cascade' required=True args: 'ir.model.fields'
  • name Char
    related='field_id.field_description'
Public methods (0)

No public methods.

New fields (11)
  • action Selection
    compute='_compute_action' compute_sudo=False precompute=True readonly=False required=True store=True string='Related Customer' args: [('create', 'Create a new customer'), ('exist', 'Link to an existing customer')]
  • commercial_partner_id Many2one → res.partner
    compute='_compute_commercial_partner_id' compute_sudo=False domain=[('is_company', '=', True)] readonly=False store=True args: 'res.partner', 'Company'
  • duplicated_lead_ids Many2many → crm.lead
    compute='_compute_duplicated_lead_ids' compute_sudo=False context={'active_test': False} readonly=False store=True string='Opportunities' args: 'crm.lead'
  • force_assignment Boolean
    default=True help='If checked, forces salesman to be updated on updated opportunities even if already set.' args: 'Force assignment'
  • lead_contact_name Char
    help=False related='lead_id.contact_name'
  • lead_id Many2one → crm.lead
    required=True args: 'crm.lead', 'Associated Lead'
  • lead_partner_name Char
    help=False related='lead_id.partner_name'
  • name Selection
    compute='_compute_name' compute_sudo=False readonly=False store=True args: [('convert', 'Convert to opportunity'), ('merge', 'Merge with existing opportunities')], 'Conversion Action'
  • partner_id Many2one → res.partner
    compute='_compute_partner_id' compute_sudo=False readonly=False store=True args: 'res.partner', 'Customer'
  • team_id Many2one → crm.team
    compute='_compute_team_id' compute_sudo=False readonly=False store=True args: 'crm.team', 'Sales Team'
  • user_id Many2one → res.users
    compute='_compute_user_id' compute_sudo=False readonly=False store=True args: 'res.users', 'Salesperson'
Public methods (2)
  • action_apply(self)
  • default_get(self, fields)
    @api.model
    Allow support of active_id / active_model instead of jut default_lead_id to ease window action definitions, and be backward compatible.

New fields (6)
  • action Selection
    ondelete={'each_exist_or_create': <expr>} selection_add=[('each_exist_or_create', 'Use existing partner or create')] string='Related Customer'
  • deduplicate Boolean
    default=True help='Merge with existing leads/opportunities of each partner' args: 'Apply deduplication'
  • force_assignment Boolean
    default=False
  • lead_id Many2one
    required=False
  • lead_tomerge_ids Many2many → crm.lead
    context={'active_test': False} default=<expr> string='Active Leads' args: 'crm.lead', 'crm_convert_lead_mass_lead_rel'
  • user_ids Many2many → res.users
    string='Salespersons' args: 'res.users'
Public methods (1)
  • action_mass_convert(self)

New fields (3)
  • active Boolean
    default=True args: 'Active'
  • leads_count Integer
    compute='_compute_leads_count' args: 'Leads Count'
  • name Char
    required=True translate=True args: 'Description'
Public methods (1)
  • action_lost_leads(self)

New fields (3)
  • opportunity_ids Many2many → crm.lead
    context={'active_test': False} string='Leads/Opportunities' args: 'crm.lead', 'merge_opportunity_rel', 'merge_id', 'opportunity_id'
  • team_id Many2one → crm.team
    compute='_compute_team_id' readonly=False store=True args: 'crm.team', 'Sales Team'
  • user_id Many2one → res.users
    domain="[('share', '=', False)]" args: 'res.users', 'Salesperson'
Public methods (2)
  • action_merge(self)
  • default_get(self, fields)
    @api.model
    Use active_ids from the context to fetch the leads/opps to merge. In order to get merged, these leads/opps cannot be already 'Won' (closed)

New fields (4)
  • active Boolean
    default=True args: 'Active'
  • name Char
    required=True translate=True args: 'Plan Name'
  • number_of_months Integer
    required=True args: '# Months'
  • sequence Integer
    default=10 args: 'Sequence'
Public methods (0)

No public methods.

New fields (9)
  • color Integer
    export_string_translation=False string='Color'
  • fold Boolean
    help='This stage is folded in the kanban view when there are no records in that stage to display.' args: 'Folded in Pipeline'
  • is_won Boolean
    args: 'Is Won Stage?'
  • name Char
    required=True translate=True args: 'Stage Name'
  • requirements Text
    help="Enter here the internal requirements for this stage (ex: Offer sent to customer). It will appear as a tooltip over the stage's name." args: 'Requirements'
  • rotting_threshold_days Integer
    default=0 help="Highlight opportunities that haven't been updated for this many days. Set to 0 to disable. Changing this parameter will not affect the rotting status/date of resources last updated before this change." args: 'Days to rot'
  • sequence Integer
    default=1 help='Used to order stages. Lower is better.' args: 'Sequence'
  • team_count Integer
    compute='_compute_team_count' args: 'team_count'
  • team_ids Many2many → crm.team
    ondelete='restrict' string='Sales Teams' args: 'crm.team'
Public methods (1)
  • write(self, vals)
    Since leads that are in a won stage must have their probability = 100%, this override ensures that setting a stage as won will set all the leads in that stage to probability = 100%. Inversely, if a won stage is not marked as won anymore, the lead probability should be recomputed based on automated probability. Note: If a user sets a stage as won and changes his mind right after, the manual probability will be lost in the process.

New fields (12)
  • alias_id Many2one
    help='The email address associated with this channel. New emails received will automatically create new leads assigned to the channel.'
  • assignment_auto_enabled Boolean
    compute='_compute_assignment_enabled' args: 'Auto Assignment'
  • assignment_domain Char
    help='Additional filter domain when fetching unassigned leads to allocate to the team.' tracking=True args: 'Assignment Domain'
  • assignment_enabled Boolean
    compute='_compute_assignment_enabled' args: 'Lead Assign'
  • assignment_max Integer
    compute='_compute_assignment_max' help='Monthly average leads capacity for all salesmen belonging to the team' args: 'Lead Average Capacity'
  • assignment_optout Boolean
    args: 'Skip auto assignment'
  • lead_all_assigned_month_count Integer
    compute='_compute_lead_all_assigned_month_count' help='Number of leads and opportunities assigned this last month.' string='# Leads/Opps assigned this month'
  • lead_all_assigned_month_exceeded Boolean
    compute='_compute_lead_all_assigned_month_count' help='True if the monthly lead assignment count is greater than the maximum assignment limit, false otherwise.' args: 'Exceed monthly lead assignement'
  • lead_properties_definition PropertiesDefinition
    args: 'Lead Properties'
  • lead_unassigned_count Integer
    compute='_compute_lead_unassigned_count' string='# Unassigned Leads'
  • use_leads Boolean
    help='Check this box to filter and qualify incoming requests as leads before converting them into opportunities and assigning them to a salesperson.' args: 'Leads'
  • use_opportunities Boolean
    default=True help='Check this box to manage a presales process with opportunities.' args: 'Pipeline'
Public methods (8)
  • action_assign_leads(self)
    Manual (direct) leads assignment. This method both * assigns leads to teams given by self; * assigns leads to salespersons belonging to self; See sub methods for more details about assign process. :returns: action, a client notification giving some insights on assign process;
  • action_open_leads(self)
  • action_open_unassigned_leads(self)
  • action_opportunity_forecast(self)
    @api.model
  • action_primary_channel_button(self)
  • action_your_pipeline(self)
    @api.model
  • unlink(self)
    When unlinking, concatenate ``crm.lead.scoring.frequency`` linked to the team into "no team" statistics.
  • write(self, vals)

New fields (7)
  • assignment_domain Char
    tracking=True args: 'Assignment Domain'
  • assignment_domain_preferred Char
    tracking=True args: 'Preference assignment Domain'
  • assignment_enabled Boolean
    related='crm_team_id.assignment_enabled'
  • assignment_max Integer
    default=30 args: 'Average Leads Capacity (on 30 days)'
  • assignment_optout Boolean
    args: 'Pause assignment'
  • lead_day_count Integer
    compute='_compute_lead_day_count' help='Number of leads assigned to this member in the last 24 hours (lost leads excluded)' args: 'Leads (last 24h)'
  • lead_month_count Integer
    compute='_compute_lead_month_count' help='Number of leads assigned to this member in the last 30 days' args: 'Leads (30 days)'
Public methods (0)

No public methods.

New fields (4)
  • kpi_crm_lead_created Boolean
    args: 'New Leads'
  • kpi_crm_lead_created_value Integer
    compute='_compute_kpi_crm_lead_created_value'
  • kpi_crm_opportunities_won Boolean
    args: 'Opportunities Won'
  • kpi_crm_opportunities_won_value Integer
    compute='_compute_kpi_crm_opportunities_won_value'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (3)
  • create(self, vals_list)
    @api.model_create_multi
  • unlink(self)
  • write(self, vals)

New fields (0)

No new fields.

Public methods (1)
  • action_create_calendar_event(self)
    Small override of the action that creates a calendar. If the activity is linked to a crm.lead through the "opportunity_id" field, we include in the action context the default values used when scheduling a meeting from the crm.lead form view. e.g: It will set the partner_id of the crm.lead as default attendee of the meeting.

New fields (19)
  • crm_auto_assignment_action Selection
    compute='_compute_crm_auto_assignment_data' help='Manual assign allow to trigger assignment from team form view using an action button. Automatic configures a cron running repeatedly assignment in all teams.' readonly=False store=True string='Auto Assignment Action' args: [('manual', 'Manually'), ('auto', 'Repeatedly')]
  • crm_auto_assignment_interval_number Integer
    compute='_compute_crm_auto_assignment_data' help='Number of interval type between each cron run (e.g. each 2 days or each 4 days)' readonly=False store=True string='Repeat every'
  • crm_auto_assignment_interval_type Selection
    compute='_compute_crm_auto_assignment_data' help='Interval type between each cron run (e.g. each 2 days or each 2 hours)' readonly=False store=True string='Auto Assignment Interval Unit' args: [('minutes', 'Minutes'), ('hours', 'Hours'), ('days', 'Days'), ('weeks', 'Weeks')]
  • crm_auto_assignment_run_datetime Datetime
    compute='_compute_crm_auto_assignment_data' readonly=False store=True string='Auto Assignment Next Execution Date'
  • crm_use_auto_assignment Boolean
    config_parameter='crm.lead.auto.assignment' string='Rule-Based Assignment'
  • group_use_lead Boolean
    implied_group='crm.group_use_lead' string='Leads'
  • group_use_recurring_revenues Boolean
    implied_group='crm.group_use_recurring_revenues' string='Recurring Revenues'
  • is_membership_multi Boolean
    config_parameter='sales_team.membership_multi' string='Multi Teams'
  • lead_enrich_auto Selection
    config_parameter='crm.iap.lead.enrich.setting' default='auto' string='Enrich lead automatically' args: [('manual', 'Enrich leads on demand only'), ('auto', 'Enrich all leads automatically')]
  • lead_mining_in_pipeline Boolean
    config_parameter='crm.lead_mining_in_pipeline' args: 'Create a lead mining request directly from the opportunity pipeline.'
  • module_crm_iap_enrich Boolean
    args: 'Enrich your leads automatically with company data based on their email address.'
  • module_crm_iap_mine Boolean
    args: 'Generate new leads based on their country, industries, size, etc.'
  • module_partnership Boolean
    args: 'Membership / Partnership'
  • module_website_crm_iap_reveal Boolean
    args: "Create Leads/Opportunities from your website's traffic"
  • predictive_lead_scoring_field_labels Char
    compute='_compute_predictive_lead_scoring_field_labels'
  • predictive_lead_scoring_fields Many2many → crm.lead.scoring.frequency.field
    compute='_compute_pls_fields' inverse='_inverse_pls_fields_str' string='Lead Scoring Frequency Fields' args: 'crm.lead.scoring.frequency.field'
  • predictive_lead_scoring_fields_str Char
    config_parameter='crm.pls_fields' string='Lead Scoring Frequency Fields in String'
  • predictive_lead_scoring_start_date Date
    compute='_compute_pls_start_date' inverse='_inverse_pls_start_date_str' string='Lead Scoring Starting Date'
  • predictive_lead_scoring_start_date_str Char
    config_parameter='crm.pls_start_date' string='Lead Scoring Starting Date in String'
Public methods (2)
  • action_crm_assign_leads(self)
  • set_values(self)

New fields (2)
  • opportunity_count Integer
    compute='_compute_opportunity_count' groups='sales_team.group_sale_salesman' string='Opportunity Count'
  • opportunity_ids One2many → crm.lead
    domain=[('type', '=', 'opportunity')] string='Opportunities' args: 'crm.lead', 'partner_id'
Public methods (1)
  • action_view_opportunity(self)

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (2)
  • crm_lead_count Integer
    compute='_compute_crm_lead_count' groups='sales_team.group_sale_salesman' args: 'Leads/Opportunities count'
  • use_leads Boolean
    compute='_compute_use_leads' args: 'Use Leads'
Public methods (1)
  • action_redirect_to_leads_opportunities(self)

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…