"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.
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'}
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)