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_page_id

Inputs Method Outputs
"""Will find the page to which this question belongs to by looking inside the corresponding survey"""
for question in self:
            if question.is_page:
                question.page_id = None
            else:
                page = None
                for q in question.survey_id.question_and_page_ids.sorted():
                    if q == question:
                        break
                    if q.is_page:
                        page = q
                question.page_id = page

Back to entity