[IMP] event,website_event_question: Copy more fields on duplicate
In the Event App, when we duplicating an event, the email schedule and Questions also duplicate.
This commit is contained in:
committed by
Yannick Tivisse
parent
ccb907a185
commit
98a3482369
@@ -47,7 +47,7 @@ class event_event(models.Model):
|
||||
readonly=False, states={'done': [('readonly', True)]},
|
||||
oldname='type')
|
||||
color = fields.Integer('Kanban Color Index')
|
||||
event_mail_ids = fields.One2many('event.mail', 'event_id', string='Mail Schedule', default=lambda self: self._default_event_mail_ids())
|
||||
event_mail_ids = fields.One2many('event.mail', 'event_id', string='Mail Schedule', default=lambda self: self._default_event_mail_ids(), copy=True)
|
||||
|
||||
@api.model
|
||||
def _default_event_mail_ids(self):
|
||||
|
||||
@@ -7,7 +7,7 @@ class EventEvent(models.Model):
|
||||
""" Override Event model to add optional questions when buying tickets. """
|
||||
_inherit = 'event.event'
|
||||
|
||||
question_ids = fields.One2many('event.question', 'event_id', 'Questions')
|
||||
question_ids = fields.One2many('event.question', 'event_id', 'Questions', copy=True)
|
||||
general_question_ids = fields.One2many('event.question', 'event_id', 'Questions',
|
||||
domain=[('is_individual', '=', False)])
|
||||
specific_question_ids = fields.One2many('event.question', 'event_id', 'Questions',
|
||||
@@ -41,7 +41,7 @@ class EventQuestion(models.Model):
|
||||
|
||||
title = fields.Char(required=True, translate=True)
|
||||
event_id = fields.Many2one('event.event', required=True, ondelete='cascade')
|
||||
answer_ids = fields.One2many('event.answer', 'question_id', "Answers", required=True)
|
||||
answer_ids = fields.One2many('event.answer', 'question_id', "Answers", required=True, copy=True)
|
||||
sequence = fields.Integer(default=10)
|
||||
is_individual = fields.Boolean('Ask each attendee',
|
||||
help="If True, this question will be asked for every attendee of a reservation. If "
|
||||
|
||||
Reference in New Issue
Block a user