You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
823 B

  1. from openerp.osv import osv
  2. class mail_message(osv.Model):
  3. _inherit = 'mail.message'
  4. def check_access_rule(self, cr, uid, ids, operation, context=None):
  5. group_all_emails = self.pool.get('ir.model.data').xmlid_to_object(cr, uid, 'mail_outgoing.group_all_emails', context=context)
  6. user = self.pool['res.users'].browse(cr, uid, uid, context)
  7. user_groups = set(user.groups_id)
  8. if user_groups.issuperset(group_all_emails):
  9. return
  10. return super(mail_message, self).check_access_rule(cr, uid, ids, operation, context)
  11. class mail_mail(osv.Model):
  12. _name = 'mail.mail'
  13. _inherit = ['mail.mail', 'ir.needaction_mixin']
  14. _needaction = True
  15. def _needaction_domain_get(self, cr, uid, context=None):
  16. return [('state','in', ['outgoing', 'exception'])]