diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2020-02-07 10:28:56 +0000 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2020-02-07 14:03:09 +0000 |
| commit | 4b583427437e894a3b90c4ac88cee36ec34eb6b6 (patch) | |
| tree | fd2888889592160d40a0676242390ccb9b2172a8 /addons | |
| parent | bfad367afe34e1c93b38fd82c706ab78304b0d63 (diff) | |
[FIX] utm: record creation
Make sure `is_website` is an existing field of the model at creation.
opw-2192139
closes odoo/odoo#44870
X-original-commit: 5daf25f2c693c17e75223f8e3502d5c4121cb3b5
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/utm/models/utm_mixin.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/utm/models/utm_mixin.py b/addons/utm/models/utm_mixin.py index ac5c40e84bf..b74d33857d6 100644 --- a/addons/utm/models/utm_mixin.py +++ b/addons/utm/models/utm_mixin.py @@ -37,7 +37,10 @@ class UtmMixin(models.AbstractModel): Model = self.env[field.comodel_name] records = Model.search([('name', '=', value)], limit=1) if not records: - records = Model.create({'name': value, 'is_website': True}) + if 'is_website' in records._fields: + records = Model.create({'name': value, 'is_website': True}) + else: + records = Model.create({'name': value}) value = records.id if value: values[field_name] = value |
