<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <!-- Tree View for User Questionnaire Statistics -->
    <record id="view_user_questionnaire_statistics_tree" model="ir.ui.view">
        <field name="name">user.questionnaire.statistics.tree</field>
        <field name="model">user.questionnaire</field>
        <field name="arch" type="xml">
            <tree string="Questionnaire Statistics">
                <field name="questionnaire_id"/>
                <field name="user_id"/>
                <field name="progress" widget="progressbar"/>
                <field name="is_finished"/>
            </tree>
        </field>
    </record>

    <!-- Search View for User Questionnaire Statistics -->
    <record id="view_user_questionnaire_statistics_search" model="ir.ui.view">
        <field name="name">user.questionnaire.statistics.search</field>
        <field name="model">user.questionnaire</field>
        <field name="arch" type="xml">
            <search string="Search Questionnaire Statistics">
                <field name="questionnaire_id"/>
                <field name="user_id"/>
                <filter string="Completed" name="completed" domain="[('is_finished', '=', True)]"/>
                <filter string="In Progress" name="in_progress" domain="[('is_finished', '=', False)]"/>
                <group expand="0" string="Group By">
                    <filter string="Questionnaire" name="group_by_questionnaire" context="{'group_by': 'questionnaire_id'}"/>
                    <filter string="User" name="group_by_user" context="{'group_by': 'user_id'}"/>
                    <filter string="Status" name="group_by_status" context="{'group_by': 'is_finished'}"/>
                </group>
            </search>
        </field>
    </record>

    <!-- Graph View for User Questionnaire Statistics -->
    <record id="view_user_questionnaire_statistics_graph" model="ir.ui.view">
        <field name="name">user.questionnaire.statistics.graph</field>
        <field name="model">user.questionnaire</field>
        <field name="arch" type="xml">
            <graph string="Questionnaire Statistics" type="bar">
                <field name="questionnaire_id"/>
                <field name="progress" type="measure"/>
            </graph>
        </field>
    </record>

    <record id="action_user_question_answers" model="ir.actions.act_window">
        <field name="name">User Answers</field>
        <field name="res_model">user.question</field>
        <field name="view_mode">tree,form</field>
        <field name="domain">[('user_questionnaire_id.user_id', '=', active_id), ('user_questionnaire_id.questionnaire_id', '=', context.get('questionnaire_id'))]</field>
        <field name="context">{'default_user_questionnaire_id': active_id}</field>
    </record>

    <!-- Action for Statistics -->
    <record id="action_questionnaire_statistics" model="ir.actions.act_window">
        <field name="name">Questionnaire Statistics</field>
        <field name="res_model">user.questionnaire</field>
        <field name="view_mode">tree,graph</field>
        <field name="search_view_id" ref="view_user_questionnaire_statistics_search"/>
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">
                No questionnaire statistics found
            </p>
            <p>
                Statistics will appear here once users start answering questionnaires.
            </p>
        </field>
        <field name="context">{'group_by': 'questionnaire_id'}</field>
    </record>

    <!-- Menu Item for Statistics -->
    <menuitem id="menu_questionnaire_statistics"
            name="Statistics"
            parent="menu_questionnaire_root"
            action="action_questionnaire_statistics"
            sequence="20"/>
</odoo> fix this view, trigger action_user_question_answers action whenever when user clicks to users name