summaryrefslogtreecommitdiff
path: root/addons/event_crm/models
diff options
context:
space:
mode:
authorThibault Francois <tfr@openerp.com>2021-04-26 13:39:54 +0000
committerThibault Francois <tfr@openerp.com>2021-04-26 14:50:30 +0000
commit9a4e792c38124e1c3902b37ea4604a17788c7710 (patch)
tree1211694b71c158679b68e786d9bcf13e690aae54 /addons/event_crm/models
parent5f6d6cf1b4c76a2f0031c269501054e816c65e97 (diff)
[FIX] event_crm: fix False - False lead creation
Use Case -------- Have two (or more) rules with mutually exclusive domain for that can be apply on the same event with lead_creation_basis = order Create a registration that match one of the rule Problem ------- The lead for this rule is created properly but there is also another lead with the name False - False that is created for the second rule for which the registration does not match the filter Solution -------- Create a lead only when there is a non empty record set in the registration group closes odoo/odoo#69853 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/event_crm/models')
-rw-r--r--addons/event_crm/models/event_lead_rule.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/event_crm/models/event_lead_rule.py b/addons/event_crm/models/event_lead_rule.py
index 47c425fef26..08c5c114cb0 100644
--- a/addons/event_crm/models/event_lead_rule.py
+++ b/addons/event_crm/models/event_lead_rule.py
@@ -180,7 +180,7 @@ class EventLeadRule(models.Model):
'description': "%s\n%s" % (lead.description, additionnal_description),
'registration_ids': [(4, reg.id) for reg in group_registrations],
})
- else:
+ elif group_registrations:
lead_vals_list.append(group_registrations._get_lead_values(rule))
return self.env['crm.lead'].create(lead_vals_list)