Skip to content
Snippets Groups Projects
Commit 0d37b138 authored by Thibault Delavallée's avatar Thibault Delavallée
Browse files

[FIX] event_crm: correctly compare IDs to check registration changes


When checking updated values of a registration to propagate to its linked lead
we may compare a recordset to IDs. This commit fixes that by always comparing
IDs.

Task-3431124

Part-of: odoo/odoo#128823
Co-authored-by: default avatarJeremy Hennecart <jeh@odoo.com>
parent 941d9429
Branches
Tags
No related merge requests found
......@@ -336,8 +336,8 @@ class EventRegistration(models.Model):
def _convert_value(self, value, field_name):
""" Small tool because convert_to_write is touchy """
if value and self._fields[field_name].type in ['many2many', 'one2many']:
if isinstance(value, models.BaseModel) and self._fields[field_name].type in ['many2many', 'one2many']:
return value.ids
if value and self._fields[field_name].type == 'many2one':
if isinstance(value, models.BaseModel) and self._fields[field_name].type == 'many2one':
return value.id
return value
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment