commit
8961704243
|
|
@ -55,7 +55,7 @@ class Visit(models.Model):
|
|||
default=lambda self: _('New'))
|
||||
otp_code = fields.Char(string="OTP Code", readonly=True, copy=False)
|
||||
otp_generated_at = fields.Datetime(string="OTP Generated At", readonly=True, copy=False)
|
||||
response_id = fields.Many2one('survey.user_input', string="Survey Responses", ondelete='restrict', copy=False)
|
||||
response_id = fields.Many2one('survey.user_input', string="Survey Responses", copy=False)
|
||||
response_count = fields.Integer(compute="_compute_response_count", store=True, string="Responses Count", copy=False)
|
||||
survey_url = fields.Char(string="Survey URL")
|
||||
|
||||
|
|
@ -239,7 +239,7 @@ class Visit(models.Model):
|
|||
if self.response_id:
|
||||
response = self.response_id
|
||||
if response.survey_id.id != survey.id or response.state != 'done':
|
||||
response.unlink()
|
||||
response.sudo().unlink()
|
||||
self.response_id = False
|
||||
|
||||
if not self.response_id:
|
||||
|
|
|
|||
Loading…
Reference in New Issue