Files
odoo_source/addons/event/models/event_config_settings.py
T
Thibault Delavallée 274e94d715 [REF] event: remove group_mail_scheduling as email scheduling is part of event management
In the interface using the email scheduler of events is limited to a group
that is not activated by default. However by default emails are sent and
therefore cannot be configured by the event maanger.

As managers should always be able to configure sent emails we decided to
remove the group and always give access to the email scheduling tab of the
event form view.
2016-08-19 15:49:37 +02:00

39 lines
1.6 KiB
Python

# -*- coding: utf-8 -*-
from odoo import api, fields, models
class event_config_settings(models.TransientModel):
_name = 'event.config.settings'
_inherit = 'res.config.settings'
module_event_sale = fields.Selection([
(0, "All events are free"),
(1, 'Allow selling tickets')
], "Tickets",
help='Install the event_sale module')
module_website_event_track = fields.Selection([
(0, "No mini website per event"),
(1, 'Allow tracks, agenda and dedicated menus/website per event')
], "Tracks and Agenda",
help='Install the module website_event_track')
module_website_event_questions = fields.Selection([
(0, "No extra questions on registrations"),
(1, 'Allow adding extra questions on registrations')
], "Registration Survey",
help='Install the website_event_questions module')
auto_confirmation = fields.Selection([
(1, 'No validation step on registration'),
(0, "Manually confirm every registration")
], "Auto Confirmation",
help='Unselect this option to manually manage draft event and draft registration')
module_event_barcode = fields.Boolean("Scan badges to confirm attendances",
help="Install the event_barcode module")
@api.multi
def set_default_auto_confirmation(self):
if self.env.user._is_admin() or self.env['res.users'].has_group('event.group_event_manager'):
IrValues = self.env['ir.values'].sudo()
else:
IrValues = self.env['ir.values']
IrValues.set_default('event.config.settings', 'auto_confirmation', self.auto_confirmation)