[FIX] mail: user cannot edit a message that is not a comment type
Before this PR, user could edit notifications message. task-2713602 closes odoo/odoo#81803 X-original-commit: 45e9f367d583ec8fafdf19c9e5451bdff0e16e62 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
@@ -5656,3 +5656,9 @@ msgstr ""
|
||||
#, python-format
|
||||
msgid "unknown target model %s"
|
||||
msgstr ""
|
||||
|
||||
#. module: mail
|
||||
#: code:addons/mail/models/mail_thread.py:1892
|
||||
#, python-format
|
||||
msgid "Only messages type comment can have their content updated"
|
||||
msgstr ""
|
||||
|
||||
@@ -459,6 +459,8 @@ class MailThread(models.AbstractModel):
|
||||
raise exceptions.UserError(_("Only logged notes can have their content updated on model '%s'", self._name))
|
||||
if message.tracking_value_ids:
|
||||
raise exceptions.UserError(_("Messages with tracking values cannot be modified"))
|
||||
if not message.message_type == 'comment':
|
||||
raise exceptions.UserError(_("Only messages type comment can have their content updated"))
|
||||
|
||||
# ------------------------------------------------------
|
||||
# TRACKING / LOG
|
||||
|
||||
Reference in New Issue
Block a user