From d7bd885170c45c34742ef638b9b22041d400a1fa Mon Sep 17 00:00:00 2001 From: "Julien (jula)" Date: Wed, 16 Aug 2023 11:26:49 +0200 Subject: [PATCH] [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#136880 X-original-commit: cb7589cb4bb3ede1b4c4d3f8d04c376a95d42247 Signed-off-by: Christophe Simonis (chs) Signed-off-by: Julien Launois (jula) --- odoo/addons/base/wizard/base_partner_merge.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/addons/base/wizard/base_partner_merge.py b/odoo/addons/base/wizard/base_partner_merge.py index d3988d97245..058192184b5 100644 --- a/odoo/addons/base/wizard/base_partner_merge.py +++ b/odoo/addons/base/wizard/base_partner_merge.py @@ -217,7 +217,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: