diff options
| author | Juhil Somaiya <jso@odoo.com> | 2019-01-23 09:32:01 +0000 |
|---|---|---|
| committer | Juhil Somaiya <jso@odoo.com> | 2019-02-15 09:05:54 +0000 |
| commit | 02eebe15cd895b54f45cbcef1affcaa61ec8577c (patch) | |
| tree | 85d7ddee92dbe048aabf43243a0e2c949ad516db /addons/mail_bot/views | |
| parent | b35d103cc0fe64547c3212ef01ab329faf0bacc4 (diff) | |
[IMP] mail_bot: Blocked notification alert to User
If user has blocked odoo push notifications
then there's no way to enable via the OdooBot notification in the systray as it depends on the navigator
so display the alert message under users preference section.
Related Task ID: 1929547
closes odoo/odoo#30496
Diffstat (limited to 'addons/mail_bot/views')
| -rw-r--r-- | addons/mail_bot/views/assets.xml | 1 | ||||
| -rw-r--r-- | addons/mail_bot/views/discuss.xml | 9 | ||||
| -rw-r--r-- | addons/mail_bot/views/res_users_views.xml | 15 |
3 files changed, 24 insertions, 1 deletions
diff --git a/addons/mail_bot/views/assets.xml b/addons/mail_bot/views/assets.xml index 43c9a37e694..45189d82715 100644 --- a/addons/mail_bot/views/assets.xml +++ b/addons/mail_bot/views/assets.xml @@ -4,6 +4,7 @@ <template id="assets_backend" name="mailbot assets" inherit_id="web.assets_backend"> <xpath expr="." position="inside"> <script type="text/javascript" src="/mail_bot/static/src/js/mailbot_service.js"></script> + <script type="text/javascript" src="/mail_bot/static/src/js/notification_alert.js"></script> <script type="text/javascript" src="/mail_bot/static/src/js/systray_messaging_menu.js"></script> </xpath> </template> diff --git a/addons/mail_bot/views/discuss.xml b/addons/mail_bot/views/discuss.xml index 95526e6b11a..7f4de461193 100644 --- a/addons/mail_bot/views/discuss.xml +++ b/addons/mail_bot/views/discuss.xml @@ -5,4 +5,13 @@ <i t-if="status == 'bot'" class="o_mail_user_status o_user_online fa fa-heart" title="Bot" role="img" aria-label="User is a bot"/> </t> </t> + + <!-- + @param {mail.NotificationAlert} widget + --> + <t t-name="mail.NotificationAlert"> + <center t-if="widget.isNotificationBlocked" class="o_notification_alert alert alert-primary"> + Odoo Push notifications have been blocked. Go to your browser settings to allow them. + </center> + </t> </templates> diff --git a/addons/mail_bot/views/res_users_views.xml b/addons/mail_bot/views/res_users_views.xml index 066ae58bd48..296e5380485 100644 --- a/addons/mail_bot/views/res_users_views.xml +++ b/addons/mail_bot/views/res_users_views.xml @@ -27,4 +27,17 @@ </data> </field> </record> -</data></odoo>
\ No newline at end of file + + <!-- Blocked notification alert --> + <record id="view_users_form_inherit_mail_notification_alert" model="ir.ui.view"> + <field name="name">res.users.preferences.form.notification.alert</field> + <field name="model">res.users</field> + <field name="inherit_id" ref="base.view_users_form_simple_modif"/> + <field name="arch" type="xml"> + <xpath expr="//field[@name='image']" position="before"> + <widget name="notification_alert"/> + </xpath> + </field> + </record> + +</data></odoo> |
