From a13c15fd442bbfc5c283f71c8d349e33bc70cf6a Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Fri, 2 Sep 2016 14:12:24 +0200 Subject: [PATCH] [FIX] crm: merge partner wizard, traceback on close In the merge partner wizard, there's a button in the footer which trigger the method `action_close`. This method is decorated by an api.multi and begins with an ensure_one() and if you click on close directly after opening the wizard, self.ensure_one fails. The thing is, `action_close` only return an ir.action.act_window_close action and there's a special attribue you can set in the form view button to make it return an ir.action.act_window_close directly. If we use this technique, then there's no traceback anymore. So this is the fix. --- addons/crm/wizard/base_partner_merge.py | 5 ----- addons/crm/wizard/base_partner_merge_views.xml | 7 ++----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/addons/crm/wizard/base_partner_merge.py b/addons/crm/wizard/base_partner_merge.py index 21b3e5335b4..bdf8c4b0c41 100644 --- a/addons/crm/wizard/base_partner_merge.py +++ b/addons/crm/wizard/base_partner_merge.py @@ -434,11 +434,6 @@ class MergePartnerAutomatic(models.TransientModel): # Actions # ---------------------------------------- - @api.multi - def action_close(self): - self.ensure_one() - return {'type': 'ir.actions.act_window_close'} - @api.multi def action_skip(self): """ Skip this wizard line. Don't compute any thing, and simply redirect to the new step.""" diff --git a/addons/crm/wizard/base_partner_merge_views.xml b/addons/crm/wizard/base_partner_merge_views.xml index 67fbf2c4f50..6c86442db32 100644 --- a/addons/crm/wizard/base_partner_merge_views.xml +++ b/addons/crm/wizard/base_partner_merge_views.xml @@ -93,13 +93,10 @@ confirm="Are you sure to execute the list of automatic merges of your contacts ?" attrs="{'invisible': [('state', '!=', 'option')]}" /> or -