diff options
| author | jem-odoo <jem@openerp.com> | 2019-02-13 12:38:26 +0000 |
|---|---|---|
| committer | David Beguin <dbe@odoo.com> | 2019-02-14 09:24:10 +0000 |
| commit | ec212de5c7a7b0f4b74549add62a2988f5b38ee6 (patch) | |
| tree | 138b0f195bd0be035c7435b3ede9fdceb0036b26 /addons | |
| parent | a4a0436ddd51a84e35fa68a13833886ffbb63174 (diff) | |
[IMP] gamification,forum: remove deprecated alert when sending badge
Since 56645335b7bae0415242ec51193e493119a58879, when a user get a badge,
an email is sent. The subtype is not used anymore, so the alert
mecanism in forum to display a message to the user to show him
his new badges can not work.
This commit removes this dead code.
Task-1922159
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/gamification/data/badge.xml | 9 | ||||
| -rw-r--r-- | addons/website_forum/controllers/main.py | 1 | ||||
| -rw-r--r-- | addons/website_forum/views/website_forum.xml | 5 | ||||
| -rw-r--r-- | addons/website_profile/controllers/main.py | 8 |
4 files changed, 0 insertions, 23 deletions
diff --git a/addons/gamification/data/badge.xml b/addons/gamification/data/badge.xml index 6596bcfe0dc..50f7e765a02 100644 --- a/addons/gamification/data/badge.xml +++ b/addons/gamification/data/badge.xml @@ -32,15 +32,6 @@ <field name="image" type="base64" file="gamification/static/img/badge_idea-image.png"/> </record> - <!-- subtype for badge allocation --> - <record id="mt_badge_granted" model="mail.message.subtype"> - <field name="name">Badge Granted</field> - <field name="res_model">res.users</field> - <field name="default" eval="True"/> - <field name="hidden" eval="True"/> - <field name="description">Badge Granted</field> - </record> - <record id="email_template_badge_received" model="mail.template"> <field name="name">Received Badge</field> <field name="subject">New badge ${object.badge_id.name} granted</field> diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py index ea85c1de782..c4c1be80ff7 100644 --- a/addons/website_forum/controllers/main.py +++ b/addons/website_forum/controllers/main.py @@ -560,7 +560,6 @@ class WebsiteForum(WebsiteProfile): values .update({ 'users': users, 'main_object': forum, - 'notifications': self._get_badge_granted_messages(), 'pager': pager, }) diff --git a/addons/website_forum/views/website_forum.xml b/addons/website_forum/views/website_forum.xml index 0b67c78076d..8de274e0be8 100644 --- a/addons/website_forum/views/website_forum.xml +++ b/addons/website_forum/views/website_forum.xml @@ -53,11 +53,6 @@ <div id="wrap" t-attf-class="container #{website_forum_action}"> <div class="row"> <div class="col o_left_forum_container mb16 mt16"> - <div t-foreach="notifications or []" t-as="notification" class="alert alert-success alert-dismissable" role="status"> - <button type="button" class="close notification_close" t-att-id="notification.id" data-dismiss="alert" aria-label="Close">&times;</button> - <div t-field="notification.body"/> - <a t-attf-href="/forum/#{ slug(forum) }/user/#{ user.id }#badges" class="fa fa-arrow-right">View Your Badges</a> - </div> <div t-if="not validation_email_sent and not is_public_user and user.karma == 0" class="alert alert-danger alert-dismissable" role="alert"> <button type="button" class="close validation_email_close" data-dismiss="alert" aria-label="Close">&times;</button> <div> diff --git a/addons/website_profile/controllers/main.py b/addons/website_profile/controllers/main.py index 3372f6954e9..b1a29efe708 100644 --- a/addons/website_profile/controllers/main.py +++ b/addons/website_profile/controllers/main.py @@ -59,7 +59,6 @@ class WebsiteProfile(http.Controller): values.update({ 'email_required': kwargs.get('email_required'), 'countries': countries, - 'notifications': self._get_badge_granted_messages(), 'url_param': kwargs.get('url_param'), }) return request.render("website_profile.user_profile_edit_main", values) @@ -108,13 +107,6 @@ class WebsiteProfile(http.Controller): # Badges # --------------------------------------------------- - def _get_badge_granted_messages(self): - badge_subtype = request.env.ref('gamification.mt_badge_granted', raise_if_not_found=False) - msg = request.env['mail.message'] - if badge_subtype: - msg = msg.search([('subtype_id', '=', badge_subtype.id), ('needaction', '=', True)]) - return msg - def _prepare_badges_domain(self, **kwargs): """ Hook for other modules to restrict the badges showed on profile page, depending of the context |
