event_event.py 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from odoo import models
  4. class Event(models.Model):
  5. _inherit = "event.event"
  6. def action_mass_mailing_attendees(self):
  7. return {
  8. 'name': 'Mass Mail Attendees',
  9. 'type': 'ir.actions.act_window',
  10. 'res_model': 'mailing.mailing',
  11. 'view_mode': 'form',
  12. 'target': 'current',
  13. 'context': {
  14. 'default_mailing_model_id': self.env.ref('event.model_event_registration').id,
  15. 'default_mailing_domain': repr([('event_id', 'in', self.ids), ('state', '!=', 'cancel')])
  16. },
  17. }
  18. def action_invite_contacts(self):
  19. return {
  20. 'name': 'Mass Mail Invitation',
  21. 'type': 'ir.actions.act_window',
  22. 'res_model': 'mailing.mailing',
  23. 'view_mode': 'form',
  24. 'target': 'current',
  25. 'context': {'default_mailing_model_id': self.env.ref('base.model_res_partner').id},
  26. }