Due to 'mass_mailing_sms' inheriting mailing.mailing from 'mass_mailing', activities for these two modules would show up as one "Mass Mailing" line in the systray. This commit adds additional logic to remove this "Mass Mailing" line and replace it with 2 lines: "Email Marketing" and "SMS Marketing" with their appropriately matching module icon. For consistency, when only the 'mass_mailing' module is installed, it will still display "Email Marketing". Task: 2169498
22 lines
649 B
Python
22 lines
649 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import api, models, _
|
|
|
|
|
|
class Users(models.Model):
|
|
_name = 'res.users'
|
|
_inherit = ['res.users']
|
|
|
|
@api.model
|
|
def systray_get_activities(self):
|
|
""" Update systray name of mailing.mailing from "Mass Mailing"
|
|
to "Email Marketing".
|
|
"""
|
|
activities = super(Users, self).systray_get_activities()
|
|
for activity in activities:
|
|
if activity.get('model') == 'mailing.mailing':
|
|
activity['name'] = _('Email Marketing')
|
|
break
|
|
return activities
|