mirror of
https://github.com/bringout/oca-ocb-mail.git
synced 2026-04-22 08:42:09 +02:00
19.0 vanilla
This commit is contained in:
parent
5df8c07b59
commit
daa394e8b0
2114 changed files with 564841 additions and 299642 deletions
|
|
@ -1,10 +1,10 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models
|
||||
from odoo import models, _
|
||||
|
||||
|
||||
class Event(models.Model):
|
||||
class EventEvent(models.Model):
|
||||
_inherit = "event.event"
|
||||
|
||||
def action_mass_mailing_attendees(self):
|
||||
|
|
@ -16,7 +16,8 @@ class Event(models.Model):
|
|||
'target': 'current',
|
||||
'context': {
|
||||
'default_mailing_model_id': self.env.ref('event.model_event_registration').id,
|
||||
'default_mailing_domain': repr([('event_id', 'in', self.ids), ('state', '!=', 'cancel')])
|
||||
'default_mailing_domain': repr([('event_id', 'in', self.ids), ('state', 'not in', ['cancel', 'draft'])]),
|
||||
'default_subject': _("Event: %s", self.name),
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -27,5 +28,8 @@ class Event(models.Model):
|
|||
'res_model': 'mailing.mailing',
|
||||
'view_mode': 'form',
|
||||
'target': 'current',
|
||||
'context': {'default_mailing_model_id': self.env.ref('base.model_res_partner').id},
|
||||
'context': {
|
||||
'default_mailing_model_id': self.env.ref('base.model_res_partner').id,
|
||||
'default_subject': _("Event: %s", self.name),
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ class EventRegistration(models.Model):
|
|||
_mailing_enabled = True
|
||||
|
||||
def _mailing_get_default_domain(self, mailing):
|
||||
default_domain = [('state', 'not in', ['cancel', 'draft'])]
|
||||
default_mailing_model_id = self.env.context.get('default_mailing_model_id')
|
||||
if mailing.mailing_model_id.id == default_mailing_model_id and self.env.context.get('default_mailing_domain'):
|
||||
return ast.literal_eval(self.env.context['default_mailing_domain'])
|
||||
return default_domain
|
||||
default_mailing_domain = self.env.context.get('default_mailing_domain')
|
||||
if default_mailing_model_id and mailing.mailing_model_id.id == default_mailing_model_id and default_mailing_domain:
|
||||
return ast.literal_eval(default_mailing_domain)
|
||||
return [('state', 'not in', ['cancel', 'draft'])]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue