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

  1. from odoo import models, fields, api
  2. from odoo.exceptions import UserError
  3. class SurveySurvey(models.Model):
  4. _inherit = 'survey.survey'
  5. is_template = fields.Boolean(string="Est un modèle", default=False, copy=False)
  6. # ACTIONS
  7. @api.multi
  8. def action_send_survey(self):
  9. self.ensure_one()
  10. if self.is_template:
  11. 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.")
  12. return super(SurveySurvey, self).action_send_survey()