[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.
This commit is contained in:
Simon Lejeune
2016-09-02 15:31:40 +02:00
parent 8a4635a4e2
commit a13c15fd44
2 changed files with 2 additions and 10 deletions
-5
View File
@@ -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."""
@@ -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>