mirror of https://github.com/OCA/social.git
Add show message id if display_name null
parent
b0e6937232
commit
d23137df65
|
@ -2,3 +2,4 @@
|
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from . import mail_tracking_value
|
||||
from . import mail_message
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
from odoo import api, models
|
||||
|
||||
|
||||
class MailMessage(models.Model):
|
||||
_inherit = "mail.message"
|
||||
|
||||
@api.model
|
||||
def name_get(self):
|
||||
res = super(MailMessage, self).name_get()
|
||||
params = self.env.context.get("params")
|
||||
if params:
|
||||
model = params.get("model")
|
||||
view_type = params.get("view_type")
|
||||
if model == "mail.tracking.value" and view_type == "form":
|
||||
for rec in res:
|
||||
if rec[1] == "False":
|
||||
new_name = (rec[0], "Message ID - " + str(rec[0]))
|
||||
res[res.index(rec)] = new_name
|
||||
return res
|
Loading…
Reference in New Issue