diff options
| author | dip-odoo <dip@odoo.com> | 2017-08-29 14:39:43 +0530 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2017-12-06 12:40:41 +0100 |
| commit | 8eea65b61dbb7957435effb660b69d57dc64108a (patch) | |
| tree | 803b581f105649aa1a943c301bed461c156ec846 | |
| parent | 8ef7af6afe54fbd59051bbbce76daadd6fdb0e86 (diff) | |
[IMP] mail: add a 'Done & Schedule Next' button in activity wizard
Purpose
=======
Users often log an activity and want to schedule another one immediatly.
We should limit the number of clicks
Specification
=============
- Mark as done should be a secondary button
- Add a new secondary button : DONE AND SCHEDULE NEXT
- It should mark the activity as done and close the modal
- It should open a new activity modal
Behavior and available options are now the same in the Chatter modal and
the wizard itself. It implies correcting the crm_tour flow
| -rw-r--r-- | addons/crm/static/src/js/tour.js | 2 | ||||
| -rw-r--r-- | addons/mail/models/mail_activity.py | 20 | ||||
| -rw-r--r-- | addons/mail/views/mail_activity_views.xml | 3 |
3 files changed, 23 insertions, 2 deletions
diff --git a/addons/crm/static/src/js/tour.js b/addons/crm/static/src/js/tour.js index f5b14443d4f..348284d7fbb 100644 --- a/addons/crm/static/src/js/tour.js +++ b/addons/crm/static/src/js/tour.js @@ -45,7 +45,7 @@ tour.register('crm_tour', { content: _t("<p>You will be able to customize your followup activities. Examples:</p><ol><li>introductory email</li><li>call 10 days after</li><li>second call 3 days after, ...</li></ol><p class='mb0'><i>Select a standard activity for now on.</i></p>"), position: "bottom", run: function (actions) { - actions.auto(".modal-footer .btn-default"); + actions.auto(".modal-footer button[special=cancel]"); }, }, { trigger: ".o_kanban_record", diff --git a/addons/mail/models/mail_activity.py b/addons/mail/models/mail_activity.py index cc53bab9fa7..a385b66bf1f 100644 --- a/addons/mail/models/mail_activity.py +++ b/addons/mail/models/mail_activity.py @@ -238,6 +238,26 @@ class MailActivity(models.Model): return message.ids and message.ids[0] or False @api.multi + def action_done_schedule_next(self): + wizard_ctx = dict( + self.env.context, + default_previous_activity_type_id=self.activity_type_id.id, + default_res_id=self.res_id, + default_res_model=self.res_model, + ) + self.action_done() + return { + 'name': _('Schedule an Activity'), + 'context': wizard_ctx, + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'mail.activity', + 'views': [(False, 'form')], + 'type': 'ir.actions.act_window', + 'target': 'new', + } + + @api.multi def action_close_dialog(self): return {'type': 'ir.actions.act_window_close'} diff --git a/addons/mail/views/mail_activity_views.xml b/addons/mail/views/mail_activity_views.xml index efc658ec47e..5e9906cc416 100644 --- a/addons/mail/views/mail_activity_views.xml +++ b/addons/mail/views/mail_activity_views.xml @@ -94,7 +94,8 @@ <button string="Schedule" name="action_close_dialog" type="object" class="btn-primary"/> <button string="Mark as Done" name="action_done" - type="object" class="btn-primary"/> + type="object" class="btn-default"/> + <button string="Done & Schedule Next" name="action_done_schedule_next" type="object" class="btn-default"/> <button string="Discard" class="btn-default" special="cancel" /> </footer> </sheet> |
