Skip to content
Snippets Groups Projects
Commit cb7589cb authored by Julien (jula)'s avatar Julien (jula)
Browse files

[FIX] base: merge partner with mixin field


__Current behavior before commit:__
The page crashes when we try to merge two partners and the
`mail.activity.mixin` model has a field with `ttype = "reference"`.

This is because a `search()` on a `mixin` model will always crash as
they are abstract class that don't represent real records.

__Description of the fix:__
Add a check to skip the iteration if `Model` is an abstract class (like
a mixin).

__To reproduce:__
1. Go to Settings > Technical > Fields
1. Create a new field
1. Set **Model** as `Activity Mixin`
1. Set **Field Type** as `reference`
1. Go to the Contacts app
1. Select two contacts
1. Click on Action > Merge > MERGE CONTACTS

opw-3458640

closes odoo/odoo#132016

Signed-off-by: default avatarChristophe Simonis (chs) <chs@odoo.com>
parent 7c21a4be
No related branches found
No related tags found
No related merge requests found
......@@ -218,7 +218,7 @@ class MergePartnerAutomatic(models.TransientModel):
# unknown model or field => skip
continue
if field.compute is not None:
if Model._abstract or field.compute is not None:
continue
for partner in src_partners:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment