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.
 

13 lines
364 B

from odoo import models, fields, api
class SurveyUserInput(models.Model):
_inherit = 'survey.user_input'
selected = fields.Boolean(string="Selected", default=False)
@api.multi
def toggle_selected(self):
unselect = self.filtered('selected')
unselect.write({'selected': False})
(self - unselect).write({'selected': True})