Purpose ======= Add more fields when we merge multiple leads to be sure not lose valuable information. Specifications ============== Those fields are propagated to the destination if the value on the destination is Falsy - referred - color - recurring_revenue - recurring_plan - function - lang_id - date_deadline - reveal_id - lead_mining_request_id - reveal_ip - reveal_iap_credits - reveal_rule_id - event_lead_rule_id - event_id The "lost_reason" field is propagated to the destination only if it's lost (otherwise, it makes no sense to have a lost reason on a non-lost lead). The field "iap_enrich_done" is set to True if at least one lead has been enriched. We also keep the sum of all the lead tags (and remove any potential duplicates). The address is taken from the lead with the most non-empty address fields (sorted by highest rank if multiple lead have the same amount of non-empty fields). Task-2447721 PR odoo/odoo#75742
14 lines
390 B
Python
14 lines
390 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import fields, models
|
|
|
|
|
|
class Lead(models.Model):
|
|
_inherit = 'crm.lead'
|
|
|
|
reveal_id = fields.Char(string='Reveal ID', help="Technical ID of reveal request done by IAP.")
|
|
|
|
def _merge_get_fields(self):
|
|
return super(Lead, self)._merge_get_fields() + ['reveal_id']
|