summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorSimon Lejeune <sle@openerp.com>2016-09-02 14:12:24 +0200
committerSimon Lejeune <sle@openerp.com>2016-09-02 15:31:40 +0200
commita13c15fd442bbfc5c283f71c8d349e33bc70cf6a (patch)
tree03253b24bcd15a20e4ae5a8a56d6654d0e543da2 /addons
parent8a4635a4e209db45162dacb3f4ec174ec786789a (diff)
[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.
Diffstat (limited to 'addons')
-rw-r--r--addons/crm/wizard/base_partner_merge.py5
-rw-r--r--addons/crm/wizard/base_partner_merge_views.xml7
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
@@ -435,11 +435,6 @@ class MergePartnerAutomatic(models.TransientModel):
# ----------------------------------------
@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."""
if self.current_line_id:
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')]}" />
<span class="or_cancel" attrs="{'invisible': [('state', '=', 'finished')]} ">or
- <button name="action_close" special="nosave" string="Cancel" type="object" class="oe_link oe_inline"/>
+ <button special="cancel" string="Cancel" type="object" class="oe_link oe_inline"/>
</span>
<span class="or_cancel" attrs="{'invisible': [('state', '!=', 'finished')]} ">
- <button name="action_close" special="nosave"
- string="Close"
- type="object"
- class="oe_link oe_inline"/>
+ <button special="cancel" string="Close" type="object" class="oe_link oe_inline"/>
</span>
</footer>
</form>