diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 9e0fc96cc14..67746a6228a 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -1314,12 +1314,6 @@ class mail_thread(osv.AbstractModel): "Invalid thread_id; should be 0, False, an ID or a list with one ID" if isinstance(thread_id, (list, tuple)): thread_id = thread_id[0] - - #check login user is employee - #raise error on comment message if user is not employee - employee = self._check_user_is_employee(cr, uid, context=context) - if not employee and type == 'comment': - raise orm.except_orm(_('Warning'),_('Oops! Something went wrong, You are not allowed to post a note.')) # if we're processing a message directly coming from the gateway, the destination model was # set in the context. diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index 574edbe7298..f129e5bf0f9 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -271,7 +271,7 @@ class mail_compose_message(osv.TransientModel): context = dict(context, mail_notify_force_send=False, # do not send emails directly but use the queue instead mail_create_nosubscribe=True) # add context key to avoid subscribing the author - active_model_pool.message_post(cr, uid, [res_id], type='email', subtype=subtype, context=context, **mail_values) + active_model_pool.message_post(cr, uid, [res_id], type='comment', subtype=subtype, context=context, **mail_values) return {'type': 'ir.actions.act_window_close'} diff --git a/addons/portal/mail_message.py b/addons/portal/mail_message.py index d6a38f27378..e799343c3f7 100644 --- a/addons/portal/mail_message.py +++ b/addons/portal/mail_message.py @@ -50,8 +50,6 @@ class mail_message(osv.Model): if group_user_id not in [group.id for group in group_ids]: cr.execute('SELECT DISTINCT id FROM "%s" WHERE type = %%s AND subtype_id IS NULL AND id = ANY (%%s)' % (self._table), ('comment', ids,)) if cr.fetchall(): - raise orm.except_orm(_('Access Denied'), - _('The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: %s, Operation: %s)') % \ - (self._description, operation)) + raise orm.except_orm(_('Warning'),_('Oops! Something went wrong, You are not allowed to post a note.')) return super(mail_message, self).check_access_rule(cr, uid, ids=ids, operation=operation, context=context)