diff options
| author | ryv-odoo <ryv@odoo.com> | 2019-09-05 15:14:31 +0000 |
|---|---|---|
| committer | ryv-odoo <ryv@odoo.com> | 2019-09-12 14:53:44 +0000 |
| commit | e4afa5d6d0e97cfb1395407b0c0bd8388d81f544 (patch) | |
| tree | 41a364244eb0b5b5362bd794ebf6914cd00f3c82 /addons/sms/views | |
| parent | 076e71cb5b73ab23ca3abcc0764cc9e46a59b38f (diff) | |
[IMP] sms: allow to create a sms context action
In the SMS template, we add the ability to create (and remove)
a contextual action on the targeted model from a sms template.
We change the sms composer to guess the composition mode,
and then to be usable by contextual action. The guess compostion mode
works differently if there are multiple target
selected (mass) or a single target (comment).
TASK_ID : 2053631
Diffstat (limited to 'addons/sms/views')
| -rw-r--r-- | addons/sms/views/sms_template_views.xml | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/addons/sms/views/sms_template_views.xml b/addons/sms/views/sms_template_views.xml index 24acfcac134..5672e37d9c8 100644 --- a/addons/sms/views/sms_template_views.xml +++ b/addons/sms/views/sms_template_views.xml @@ -7,9 +7,28 @@ <form string="SMS Templates"> <sheet> <div class="oe_button_box" name="button_box"> - <button class="oe_stat_button" name="%(sms_template_preview_action)d" icon="fa-search-plus" string="Preview" - type="action" target="new" - context="{'template_id':active_id}"/> + <field name="sidebar_action_id" invisible="1"/> + <button name="action_create_sidebar_action" type="object" + groups="base.group_system" + class="oe_stat_button" + attrs="{'invisible':[('sidebar_action_id','!=',False)]}" icon="fa-plus" + help="Add a contextual action on the related model to open a sms composer with this template"> + <div class="o_field_widget o_stat_info"> + <span class="o_stat_text">Add</span> + <span class="o_stat_text">Context Action</span> + </div> + </button> + <button name="action_unlink_sidebar_action" type="object" + groups="base.group_system" + class="oe_stat_button" icon="fa-minus" + attrs="{'invisible':[('sidebar_action_id','=',False)]}" + help="Remove the contextual action of the related model" widget="statinfo"> + <div class="o_field_widget o_stat_info"> + <span class="o_stat_text">Remove</span> + <span class="o_stat_text">Context Action</span> + </div> + </button> + <button class="oe_stat_button" name="%(sms_template_preview_action)d" icon="fa-search-plus" string="Preview" type="action" target="new"/> </div> <div class="oe_title"> <label for="name" class="oe_edit_only" string="SMS Template"/> |
