from odoo import api, fields, models, exceptions, _

class SurveyUserInput(models.Model):
    _inherit = 'survey.user_input'

    visit_id = fields.Many2one('visit.location', string="Visit")


    def _mark_done(self):
        super(SurveyUserInput, self)._mark_done()
        self.sudo().visit_id.write({
            'state': 'close'
        })
