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.

16 lines
653 B

from odoo import models, fields, api
class SurveyUserInput(models.Model):
_inherit = 'survey.user_input'
date_start = fields.Datetime(string="Start date", readonly=True, help="This date is set when the user clicks on \"Start survey\" button for the first time.")
date_done = fields.Datetime(string="Date done", readonly=True, help="This date is set when the user input is set ton \"Done\" status.")
@api.multi
def write(self, vals):
if vals.get('state', False) == 'done':
vals.update({
'date_done': fields.Datetime.now(),
})
return super(SurveyUserInput, self).write(vals)