Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.
Module: Surveys
Entity: survey.question
Compute Method: _compute_question_ids
| Inputs | Method | Outputs |
|---|---|---|
|
- """Will take all questions of the survey for which the index is higher than the index of this page - and lower than the index of the next page.""" for question in self: if question.is_page: - next_page_index = False - for page in question.survey_id.page_ids: - if page._index() > question._index(): - next_page_index = page._index() - break - - question.question_ids = question.survey_id.question_ids.filtered( - lambda q: q._index() > question._index() and (not next_page_index or q._index() < next_page_index) - ) + question.question_ids = question.survey_id.question_ids\ + .filtered(lambda q: q.page_id == question).sorted(lambda q: q._index()) else: question.question_ids = self.env['survey.question'] |
|
