[FIX] mass_mailing: open duplicate in edit mode

Since the new views, the flag `initial_view` on an action has been removed.

There were in fact multiple ways to do the same thing (open a form view in edit
mode directly with an action) (the supported option is `form_view_initial_mode`
in the context) ; the options have been cleaned up a little bit.

This was the only remaining recurrence.

Closes #22353
This commit is contained in:
Martin Geubelle
2018-01-22 13:14:44 +01:00
parent ca323c51b2
commit 8b5440c2b4
+3 -2
View File
@@ -520,14 +520,15 @@ class MassMailing(models.Model):
self.ensure_one()
mass_mailing_copy = self.copy()
if mass_mailing_copy:
context = dict(self.env.context)
context['form_view_initial_mode'] = 'edit'
return {
'type': 'ir.actions.act_window',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'mail.mass_mailing',
'res_id': mass_mailing_copy.id,
'context': self.env.context,
'flags': {'initial_mode': 'edit'},
'context': context,
}
return False