summaryrefslogtreecommitdiff
path: root/addons/mail/views/mail_activity_views.xml
diff options
context:
space:
mode:
authorXavierDo <xdo@odoo.com>2018-09-13 13:15:32 +0200
committerXavierDo <xdo@odoo.com>2018-09-18 13:44:00 +0200
commit47496b9fe5555ef23932fcfc3f2d6d6ee945daae (patch)
tree691ab48e21c4489c92259b2bb58d7c126453e3f7 /addons/mail/views/mail_activity_views.xml
parent44fd3bc8082205290e38de183d092b42c02c8215 (diff)
[IMP] mail: add force_next on activity type
A new field on activity type allow to change the behaviour of mark done & schedule next: -marking as done will automatically schedule the next activity, based on the default_next_activity. -It should also be impossible to edit an activity when this flag is on. task: #1884521
Diffstat (limited to 'addons/mail/views/mail_activity_views.xml')
-rw-r--r--addons/mail/views/mail_activity_views.xml13
1 files changed, 9 insertions, 4 deletions
diff --git a/addons/mail/views/mail_activity_views.xml b/addons/mail/views/mail_activity_views.xml
index 7b92502934f..b4e1e782b0c 100644
--- a/addons/mail/views/mail_activity_views.xml
+++ b/addons/mail/views/mail_activity_views.xml
@@ -32,9 +32,10 @@
</div>
</group>
<group>
+ <field name="force_next"/>
+ <field name="default_next_type_id" attrs="{'required': [('force_next', '=', True)]}" context="{'default_res_model_id': res_model_id}"/>
<field name="next_type_ids" widget="many2many_tags"
- context="{'default_res_model_id': res_model_id}"/>
- <field name="default_next_type_id" context="{'default_res_model_id': res_model_id}"/>
+ attrs="{'invisible': [('force_next', '=', True)]}" context="{'default_res_model_id': res_model_id}"/>
<field name="mail_template_ids" widget="many2many_tags"
domain="[('model_id', '=', res_model_id)]"
attrs="{'invisible': [('res_model_id', '=', False)]}"
@@ -100,6 +101,7 @@
<field name="res_model" invisible="1"/>
<field name="res_model_id" invisible="1"/>
<field name="res_id" invisible="1"/>
+ <field name="force_next" invisible="1"/>
<field name="previous_activity_type_id"/>
<field name="has_recommended_activities"/>
</group>
@@ -125,10 +127,13 @@
<footer>
<button string="Schedule" name="action_close_dialog"
type="object" class="btn-primary"/>
- <button string="Mark as Done" name="action_done"
+ <button attrs="{'invisible': [('force_next', '=', True)]}" string="Mark as Done" name="action_done"
type="object" class="btn-secondary"
context="{'mail_activity_quick_update': True}"/>
- <button string="Done &amp; Schedule Next" name="action_done_schedule_next"
+ <button attrs="{'invisible': [('force_next', '=', True)]}" string="Done &amp; Schedule Next" name="action_done_schedule_next"
+ type="object" class="btn-secondary"
+ context="{'mail_activity_quick_update': True}"/>
+ <button attrs="{'invisible': [('force_next', '=', False)]}" string="Done &amp; Launch Next" name="action_done_schedule_next"
type="object" class="btn-secondary"
context="{'mail_activity_quick_update': True}"/>
<button string="Discard" class="btn-secondary" special="cancel" />