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

  1. from odoo import models, fields, api
  2. class SurveyUserInput(models.Model):
  3. _inherit = 'survey.user_input'
  4. 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.")
  5. date_done = fields.Datetime(string="Date done", readonly=True, help="This date is set when the user input is set ton \"Done\" status.")
  6. @api.multi
  7. def write(self, vals):
  8. if vals.get('state', False) == 'done':
  9. vals.update({
  10. 'date_done': fields.Datetime.now(),
  11. })
  12. return super(SurveyUserInput, self).write(vals)