[FIX] survey_record_generation: unblock survey edition after a line without field
Some checks failed
tests / test (pull_request) Successful in 2m1s
pre-commit / pre-commit (pull_request) Failing after 2m14s

When a record creation has a field value line whose field is not chosen yet,
``_compute_allowed_question_ids`` returned instead of moving on to the next
line. The lines computed after it were left without a value, and Odoo raised
``Compute method failed to assign ... allowed_question_ids`` on every onchange
of the survey form, so no field of the survey could be edited or deleted any
more.

Skip to the next line instead, as already done on 18.0 (94d3bd7).
This commit is contained in:
Valentin Lab
2026-11-16 16:54:43 +01:00
parent e76f03f9a5
commit 87b42837ec
2 changed files with 29 additions and 1 deletions

View File

@@ -83,7 +83,7 @@ class SurveyRecordCreationFieldValues(models.Model):
for record_creation_field_values in self:
if not record_creation_field_values.survey_id or not record_creation_field_values.field_id:
record_creation_field_values.allowed_question_ids = None
return
continue
question_domain = [('survey_id','=',record_creation_field_values.survey_id.id)]
if record_creation_field_values.field_id.ttype in ['many2one','many2many']: