Odoo modules related to surveys
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
571 B

from odoo import models, fields, api
from odoo.exceptions import UserError
class SurveySurvey(models.Model):
_inherit = 'survey.survey'
is_template = fields.Boolean(string="Est un modèle", default=False, copy=False)
# ACTIONS
@api.multi
def action_send_survey(self):
self.ensure_one()
if self.is_template:
raise UserError("Vous ne pouvez pas partager un modèle de sondage, créez un nouveau sondage à partir de ce modèle et vous pourrez le partager.")
return super(SurveySurvey, self).action_send_survey()