[FIX] survey: answers disappear

Before this commit, in a survey, opening a question, discarding it and then reopening it no longer displayed the content of the responses.

How to reproduce
In QuestionPageOneToManyField, we overwrite the behaviour of openRecord by reloading the record to be opened. This is no longer necessary since PR 129507 as the correct record is retrieved which already contains the updated values.

How to reproduce:
Go to a survey
Click on a question with answers
Click on discard
Click on the same question

Before this commit:
Response data not displayed

After this commit:
The answer data is displayed correctly

closes odoo/odoo#131662

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
This commit is contained in:
FrancoisGe
2023-08-11 10:29:32 +02:00
parent aae9e9a277
commit eaafe9b977
@@ -102,10 +102,6 @@ class QuestionPageOneToManyField extends X2ManyField {
}
if (params.record) {
params.record = record.data[name].records.find(r => r.resId === params.record.resId);
// Force synchronization of fields that depend on sequence
// (allowed_triggering_question_ids, is_placed_before_trigger)
// as records may have been re-ordered before opening this one.
await params.record.load();
}
await openRecord(params);
};