[FIX] event: registration and confirmation template now have a domain on event.regist...
authorThibault Delavallée <tde@openerp.com>
Fri, 1 Aug 2014 08:11:36 +0000 (10:11 +0200)
committerThibault Delavallée <tde@openerp.com>
Fri, 1 Aug 2014 08:11:36 +0000 (10:11 +0200)
Otherwise all templates are displayed and this will lead to some issues.

Also added a description on event.registration, because currently its
displayed name is Email Thread.

addons/event/event.py

index 325682f..0ee90ea 100644 (file)
@@ -147,9 +147,13 @@ class event_event(models.Model):
             ('done', 'Done')
         ], string='Status', default='draft', readonly=True, required=True, copy=False,
         help="If event is created, the status is 'Draft'. If event is confirmed for the particular dates the status is set to 'Confirmed'. If the event is over, the status is set to 'Done'. If event is cancelled the status is set to 'Cancelled'.")
-    email_registration_id = fields.Many2one('email.template', string='Registration Confirmation Email',
+    email_registration_id = fields.Many2one(
+        'email.template', string='Registration Confirmation Email',
+        domain=[('model', '=', 'event.registration')],
         help='This field contains the template of the mail that will be automatically sent each time a registration for this event is confirmed.')
-    email_confirmation_id = fields.Many2one('email.template', string='Event Confirmation Email',
+    email_confirmation_id = fields.Many2one(
+        'email.template', string='Event Confirmation Email',
+        domain=[('model', '=', 'event.registration')],
         help="If you set an email template, each participant will receive this email announcing the confirmation of the event.")
     reply_to = fields.Char(string='Reply-To Email',
         readonly=False, states={'done': [('readonly', True)]},
@@ -282,8 +286,8 @@ class event_event(models.Model):
 
 
 class event_registration(models.Model):
-    """Event Registration"""
-    _name= 'event.registration'
+    _name = 'event.registration'
+    _description = 'Event Registration'
     _inherit = ['mail.thread', 'ir.needaction_mixin']
     _order = 'name, create_date desc'